You are here

function DatexCalendarIterface::fixMissingGranularities in Datex 7.2

Helper function to make up for missing granularities.

While converting dates, If some granularities are missing, It's needed to add some amount to timestamp, To have some final conversion correct. You see, Date module with only year, will store time as 2013-1-1, But it's not obvious user meant 1392 or 1391? Why? half of 2013 is 1392 (from march to december) and half is 1391, (from january to april). But this month is lost after it's converted to 2013-1-1. A fixed amount of time, (equal to choped off) amount of time, needs to be added each time. I hope I could explain it well! I guess not.

Special handling is needed for when day is present and month is not and is not supported by this method.

1 method overrides DatexCalendarIterface::fixMissingGranularities()
DatexJalali::fixMissingGranularities in datex_api/DatexJalali.inc
Make up for missing granularities.

File

datex_api/datex_api.class.inc, line 110
Provides an API to work with dates.

Class

DatexCalendarIterface
A calendar class extending DatexObject should implement this interface to function correctly. An example implemention is DatexJalali.

Code

function fixMissingGranularities(array $granuls);