Branch: Tag:

2000-07-12

2000-07-12 19:36:16 by Mirar (Pontus Hagland) <pike@sort.mirar.org>

first pike tree checkin

Rev: lib/modules/Calendar.pmod/Austrian.pmod:1.1
Rev: lib/modules/Calendar.pmod/CHANGES:1.1
Rev: lib/modules/Calendar.pmod/Calendar.pike:1.1
Rev: lib/modules/Calendar.pmod/Coptic.pmod:1.1
Rev: lib/modules/Calendar.pmod/Discordian.pmod:1.1
Rev: lib/modules/Calendar.pmod/Event.pmod:1.1
Rev: lib/modules/Calendar.pmod/Events.pmod:1.1
Rev: lib/modules/Calendar.pmod/FILES:1.1
Rev: lib/modules/Calendar.pmod/Gregorian.pmod:1.1
Rev: lib/modules/Calendar.pmod/ISO.pmod:1.1
Rev: lib/modules/Calendar.pmod/Islamic.pmod:1.1
Rev: lib/modules/Calendar.pmod/Julian.pmod:1.1
Rev: lib/modules/Calendar.pmod/Language.pmod:1.1
Rev: lib/modules/Calendar.pmod/Namedays.pmod:1.1
Rev: lib/modules/Calendar.pmod/Orthodox.pmod:1.1
Rev: lib/modules/Calendar.pmod/Roman.pmod:1.1
Rev: lib/modules/Calendar.pmod/Ruleset.pike:1.1
Rev: lib/modules/Calendar.pmod/Stardate.pmod:1.1
Rev: lib/modules/Calendar.pmod/Swedish.pmod:1.1
Rev: lib/modules/Calendar.pmod/TZnames.pmod:1.1
Rev: lib/modules/Calendar.pmod/TZrules.pmod:1.1
Rev: lib/modules/Calendar.pmod/TZs.h:1.1
Rev: lib/modules/Calendar.pmod/Time.pmod:1.1
Rev: lib/modules/Calendar.pmod/TimeRanges.pmod:1.1
Rev: lib/modules/Calendar.pmod/Timezone.pmod:1.1
Rev: lib/modules/Calendar.pmod/YMD.pmod:1.1
Rev: lib/modules/Calendar.pmod/localization.h:1.1
Rev: lib/modules/Calendar.pmod/mkrules.pike:1.1
Rev: lib/modules/Calendar.pmod/module.pmod:1.1
Rev: lib/modules/Calendar.pmod/namnsdagar:1.2(DEAD)
Rev: lib/modules/Calendar_I.pmod/Austrian.pmod:1.1
Rev: lib/modules/Calendar_I.pmod/Gregorian.pmod:1.23
Rev: lib/modules/Calendar_I.pmod/ISO.pmod:1.8
Rev: lib/modules/Calendar_I.pmod/Julian.pmod:1.1
Rev: lib/modules/Calendar_I.pmod/Orthodox.pmod:1.2
Rev: lib/modules/Calendar_I.pmod/Stardate.pmod:1.1
Rev: lib/modules/Calendar_I.pmod/Swedish.pmod:1.13
Rev: lib/modules/Calendar_I.pmod/module.pmod:1.5
Rev: lib/modules/Calendar_I.pmod/namnsdagar:1.2(DEAD)

1319:   </doc>   </docgroup>   <module name='Calendar'> + <class name='Calendar'>   <doc>   <text> -  + <p>This is the base class of the calendars.</p> + </text> +  + </doc> + <docgroup homogen-name='now' homogen-type='method'> + <method name='now'> +  <returntype> +  <object resolved='predef::Calendar.TimeRange'>TimeRange </object></returntype> +  <arguments> +  </arguments> + </method><doc> + <text> + <p>Give the zero-length time period of the + current time.</p> + </text> +  + </doc> + </docgroup> + </class> + <module name='Coptic'> + <doc> + <text>   <p> -  + This is the Coptic Orthodox Church calendar, + that starts the 11th or 12th September and has + 13 months. + </p> + </text> + <group><note/><text> + <p>The (default) names of the months + are different then other the emacs calendar; + I do not know which ones are used - the difference + seem to be only the transcription of the phonetic sounds + (B &lt;-&gt; P, etc).</p> +  + <p>I do not know for how long back the calendar is valid, + either. My sources claim that the calendar is synchronized + with the <ref resolved='predef::Calendar.Gregorian'>Gregorian</ref> calendar, which is odd. + </p> + </text></group> +  + </doc> + </module> + <module name='Discordian'> + <doc> + <text> + <p>The Discordian calendar, as described on page 34 + in the fourth edition of Principia Discordia.</p> +  + <p>Chaotic enough, it's quite simpler then the Gregorian calendar; + weeks are 5 days, and evens up on a year. Months are 73 days.</p> +  + <p>The leap day is inserted at the 60th day of the first month + (Chaos), giving the first month 74 days. The description of + the calendar is a "perpetual date converter from the gregorian + to the POEE calendar", so the leap years are the same as + the gregorians.</p> +  + <p>The Principia calls months "seasons", but for simplicity I + call them months in this calendar.</p> +  + <p>If anyone know more about how to treat the leap day - now it is + inserted in the month and week where it lands, rather then being + separated from month and weeks, I'm interested to know.</p> +  + <p>- Mirar, Pope of POEE. + </p> + </text> +  + </doc> + </module> + <module name='Event'> + <doc> + <text> + <p>subclass Event +  <ref resolved='predef::Calendar.Event'>Event</ref> is a base class, defining what +  methods an Event need to have. + subclass Day_Event +  <ref>Day_Event</ref> is a base class, extending <ref resolved='predef::Calendar.Event'>Event</ref> +  for events that are single days, using julian day numbers +  for the calculations.</p> +  + <p>subclass Nameday +  This is created by the <ref>Namedays</ref> classes +  to represent an event for a name. + subclass Namedays +  This contains a ruleset about namedays. It +  is a virtual base class. + subclass Date +  This class represents the event of a given gregorian date. +  For instance, +  <tt>Event.Date(12,10)-&gt;next(Day())</tt> +  finds the next 12 of October.</p> +  + <p>subclass Date_Weekday +  This class represents the event that a given gregorian date appears +  a given weekday. +  For instance, +  <tt>Event.Date_Weekday(12,10,5)-&gt;next(Day())</tt> +  finds the next 12 of October that is a friday.</p> +  + <p>subclass Monthday_Weekday +  This class represents the event that a given gregorian +  day of month appears a given weekday. +  For instance, +  <tt>Event.Date_Weekday(13,5)-&gt;next(Day())</tt> +  finds the next friday the 13th.</p> +  + <p>subclass Weekday +  This class represents any given weekday. +  For instance, +  <tt>Event.Weekday(5)-&gt;next(Day())</tt> +  finds the next friday.</p> +  + <p> These are also available as the pre-defined events +  "monday", "tuesday", "wednesday", "thursday", +  "friday", "saturday" and "sunday".</p> +  + <p>subclass SuperEvent +  This class holds any number of events, +  and adds the functionality of event flags. + </p> + </text> + <group><note/><text> + <p>Scanning (scan_events,next,etc) will drop flag information. + Dig out what you need with -&gt;<ref resolved='predef::Calendar.Event.holidays'>holidays</ref> et al first.</p> + </text></group> +  + </doc> + <docgroup homogen-name='create' homogen-type='method'> + <method name='create'> +  <returntype> +  <object>void </object></returntype> +  <arguments><argument name='month_day'><type><int/></type></argument> + <argument name='month'><type><int/></type></argument> +  +  </arguments> + </method><doc> + <text> + <p>The event is created by a given month day and + a month number (1=January, 12=December).</p> + </text> +  + </doc> + </docgroup> + <docgroup homogen-name='create' homogen-type='method'> + <method name='create'> +  <returntype> +  <object>void </object></returntype> +  <arguments><argument name='month_day'><type><int/></type></argument> + <argument name='month'><type><int/></type></argument> + <argument name='weekday'><type><int/></type></argument> +  +  </arguments> + </method><doc> + <text> + <p>The event is created by a given month day, + a month number (1=January, 12=December), and a + weekday number (1=Monday, 7=Sunday). + </p> + </text> + <group><note/><text> + <p>The week day numbers used + are the same as the day of week in the <ref resolved='predef::Calendar.ISO'>ISO</ref> calendar - + the <ref resolved='predef::Calendar.Gregorian'>Gregorian</ref> calendar has 1=Sunday, 7=Saturday.</p> + </text></group> +  + </doc> + </docgroup> + <docgroup homogen-name='create' homogen-type='method'> + <method name='create'> +  <returntype> +  <object>void </object></returntype> +  <arguments><argument name='month_day'><type><int/></type></argument> + <argument name='weekday'><type><int/></type></argument> +  +  </arguments> + </method><doc> + <text> + <p>The event is created by a given month day, + and a weekday number (1=Monday, 7=Sunday). + </p> + </text> + <group><note/><text> + <p>The week day numbers used + are the same as the day of week in the <ref resolved='predef::Calendar.ISO'>ISO</ref> calendar - + the <ref resolved='predef::Calendar.Gregorian'>Gregorian</ref> calendar has 1=Sunday, 7=Saturday.</p> + </text></group> +  + </doc> + </docgroup> + <docgroup homogen-name='create' homogen-type='method'> + <method name='create'> +  <returntype> +  <object>void </object></returntype> +  <arguments><argument name='month_day'><type><int/></type></argument> + <argument name='weekday'><type><int/></type></argument> +  +  </arguments> + </method><doc> + <text> + <p>The event is created by a given month day, + and a weekday number (1=Monday, 7=Sunday). + </p> + </text> + <group><note/><text> + <p>The week day numbers used + are the same as the day of week in the <ref resolved='predef::Calendar.ISO'>ISO</ref> calendar - + not the <ref resolved='predef::Calendar.Gregorian'>Gregorian</ref> or <ref resolved='predef::Calendar.Julian'>Julian</ref> + calendar that has 1=Sunday, 7=Saturday.</p> + </text></group> +  + </doc> + </docgroup> + <docgroup homogen-type='method'> + <method name='filter_flag'> +  <returntype> +  <object>SuperEvent </object></returntype> +  <arguments><argument name='flag'><type><string/></type></argument> +  +  </arguments> + </method><method name='holidays'> +  <returntype> +  <object>SuperEvent </object></returntype> +  <arguments> +  </arguments> + </method><method name='flagdays'> +  <returntype> +  <object>SuperEvent </object></returntype> +  <arguments> +  </arguments> + </method><doc> + <text> + <p>Filter out the events that has a certain flag set. + Holidays (flag "h") are the days that are marked + red in the calendar (non-working days), + Flagdays (flag "f") are the days that the flag + should be visible in (only some countries).</p> + </text> +  + </doc> + </docgroup> + <docgroup homogen-name='Event' homogen-type='inherit'> + <inherit name='Event'><classname resolved='predef::Calendar.Event'>Event</classname></inherit> + </docgroup> + <docgroup homogen-name='make_lookup' homogen-type='method'> + <method name='make_lookup'> +  <returntype> +  <object>mapping </object></returntype> +  <arguments><argument name='names'><type> +  <array><valuetype><string/></valuetype></array></type></argument> +  +  </arguments> + </method><doc> + <text> + <p>Help function to make a lookup mapping + of the names feeded to it.</p> + </text> + <group><note/><text> + <p>This function is <tt>static</tt>.</p> + </text></group> +  + </doc> + </docgroup> + <docgroup homogen-name='nameday_lookup' homogen-type='method'> + <method name='nameday_lookup'> +  <returntype> +  <object>int </object></returntype> +  <arguments><argument name='y'><type><int/></type></argument> + <argument name='name'><type><string/></type></argument> +  +  </arguments> + </method><doc> + <text> + <p>Static virtual function that gives back the + day (1..) of the year for the given name - + if the year is a non-leap year (!), -1 + if the name is on the leap day, or zero if + the name doesn't exist that year.</p> + </text> +  + </doc> + </docgroup> + <docgroup homogen-name='namedays' homogen-type='method'> + <method name='namedays'> +  <returntype> +  <mapping><indextype> +  <object resolved='predef::Calendar.TimeRange'>TimeRange</object></indextype> +  <valuetype> +  <array><valuetype><string/></valuetype></array></valuetype></mapping></returntype> +  <arguments><argument name='t'><type> +  <object resolved='predef::Calendar.TimeRange'>TimeRange</object></type></argument> +  +  </arguments> + </method><doc> + <text> + <p>Gives back an table of days with names that occur during + the time period. Note that days without names will not + appear in the returned mapping.</p> + </text> +  + </doc> + </docgroup> + <docgroup homogen-name='namedays_year' homogen-type='method'> + <method name='namedays_year'> +  <returntype> +  <array><valuetype><string/></valuetype></array></returntype> +  <arguments><argument name='y'><type><int/></type></argument> +  +  </arguments> + </method><doc> + <text> + <p>Static virtual function that should give back the array + of namedays that year, or zero if there + are no named days for that year.</p> +  + <p>The array is arranged as day 1..365 + a non-leap year, followed by the leap day. + If a day doesn't contain names, it should be zero, + not a string. If a day has more then one name, + it should be separated by a comma (in the string!).</p> + </text> +  + </doc> + </docgroup> + <docgroup homogen-name='names' homogen-type='method'> + <method name='names'> +  <returntype> +  <array><valuetype><string/></valuetype></array></returntype> +  <arguments><argument name='t'><type> +  <object resolved='predef::Calendar.TimeRange'>TimeRange</object></type></argument> +  +  </arguments> + </method><doc> + <text> + <p>Gives back an array of names that occur during + the time period, in no particular order.</p> + </text> +  + </doc> + </docgroup> + <docgroup homogen-type='method'> + <method name='next'> +  <returntype> +  <object resolved='predef::Calendar.TimeRange'>TimeRange </object></returntype> +  <arguments><argument name='from'><type> +  <object resolved='predef::Calendar.TimeRange'>TimeRange</object></type></argument> + <argument name='including'><type> +  <or><void/><int><min>0</min><max>1</max></int></or></type></argument> +  +  </arguments> + </method><method name='previous'> +  <returntype> +  <object resolved='predef::Calendar.TimeRange'>TimeRange </object></returntype> +  <arguments><argument name='from'><type> +  <object resolved='predef::Calendar.TimeRange'>TimeRange</object></type></argument> + <argument name='including'><type> +  <or><void/><int><min>0</min><max>1</max></int></or></type></argument> +  +  </arguments> + </method><doc> + <text> + <p>This calculates the next or previous occurance of the event, + from the given timerange's <b>start</b>, + including any event occuring at the start if that flag is set.</p> +  + <p>It returns zero if there is no next event.</p> +  + <p>This method is virtual in the base class.</p> + </text> +  + </doc> + </docgroup> + <docgroup homogen-type='method'> + <method name='previous'> +  <returntype> +  <object resolved='predef::Calendar.TimeRange'>TimeRange </object></returntype> +  <arguments><argument name='from'><type> +  <object resolved='predef::Calendar.TimeRange'>TimeRange</object></type></argument> + <argument name='including'><type> +  <or><void/><int><min>0</min><max>1</max></int></or></type></argument> +  +  </arguments> + </method><method name='next'> +  <returntype> +  <object resolved='predef::Calendar.TimeRange'>TimeRange </object></returntype> +  <arguments><argument name='from'><type> +  <object resolved='predef::Calendar.TimeRange'>TimeRange</object></type></argument> + <argument name='including'><type> +  <or><void/><int><min>0</min><max>1</max></int></or></type></argument> +  +  </arguments> + </method><doc> + <text> + <p>known bugs: +  Just returns the argument converted to a day.</p> + </text> +  + </doc> + </docgroup> + <docgroup homogen-type='method'> + <method name='scan'> +  <returntype> +  <array><valuetype> +  <object resolved='predef::Calendar.TimeRange'>TimeRange</object></valuetype></array></returntype> +  <arguments><argument name='in'><type> +  <object resolved='predef::Calendar.TimeRange'>TimeRange</object></type></argument> +  +  </arguments> + </method><method name='next'> +  <returntype> +  <object resolved='predef::Calendar.TimeRange'>TimeRange </object></returntype> +  <arguments><argument name='from'><type> +  <object resolved='predef::Calendar.TimeRange'>TimeRange</object></type></argument> +  +  </arguments> + </method><method name='next'> +  <returntype> +  <object resolved='predef::Calendar.TimeRange'>TimeRange </object></returntype> +  <arguments><argument name='from'><type> +  <object resolved='predef::Calendar.TimeRange'>TimeRange</object></type></argument> + <argument name='including'><type> +  <int><min>0</min><max>1</max></int></type></argument> +  +  </arguments> + </method><doc> + <text> + <p>These methods are implemented, using the + virtual method <ref resolved='predef::Calendar.Event.scan_jd'>scan_jd</ref>. + </p> + </text> + <group><seealso/><text> + <p><ref resolved='predef::Calendar.Event'>Event</ref></p></text></group> +  + </doc> + </docgroup> + <docgroup homogen-type='method'> + <method name='next_name'> +  <returntype> +  <object resolved='predef::Calendar.TimeRange'>TimeRange </object></returntype> +  <arguments><argument name='from'><type> +  <object resolved='predef::Calendar.TimeRange'>TimeRange</object></type></argument> + <argument name='name'><type><string/></type></argument> + <argument name='inclusive'><type><int/></type></argument> +  +  </arguments> + </method><method name='previous_name'> +  <returntype> +  <object resolved='predef::Calendar.TimeRange'>TimeRange </object></returntype> +  <arguments><argument name='from'><type> +  <object resolved='predef::Calendar.TimeRange'>TimeRange</object></type></argument> + <argument name='name'><type><string/></type></argument> + <argument name='inclusive'><type><int/></type></argument> +  +  </arguments> + </method><doc> + <text> + <p>Gives back the next or previous day where the name + occurs, inclusive the start of the given timerange if + that flag is non-zero.</p> + </text> +  + </doc> + </docgroup> + <docgroup homogen-name='scan_jd' homogen-type='method'> + <method name='scan_jd'> +  <returntype> +  <object>int </object></returntype> +  <arguments><argument name='realm'><type> +  <object resolved='predef::Calendar.Calendar'>Calendar</object></type></argument> + <argument name='jd'><type><int/></type></argument> + <argument name='direction'><type> +  <or> +  <int><min>-1</min><max>-1</max></int> +  <object resolved='predef::Calendar.Event.scan_jd'/><int><min>1</min><max>1</max></int></or></type></argument> +  +  </arguments> + </method><doc> + <text> + <p>These methods has to be defined, and is what + really does some work. It should return the next or previos + julian day (&gt;<i>jd</i>) when the event occurs, + or the constant <tt>NODAY</tt> if it doesn't.</p> +  + <p><i>direction</i> <tt>1</tt> is forward (next), + <tt>-1</tt> is backward (previous).</p> + </text> +  + </doc> + </docgroup> + </module> + <module name='Gregorian'> + <doc> + <text> + <p> + This is the standard conservative christian calendar, + used regularly in some countries - USA, for instance - and + which derivate - <ref>the ISO calendar</ref> - is used + in most of europe. + </p> + </text> +  + </doc> + </module> + <module name='ISO'> + <doc> + <text> + <p> + This is the standard western calendar, + which is a derivate of the Gregorian calendar, + but with weeks that starts on monday + instead of sunday.</p> +  + <p/> + </text> +  + </doc> + <docgroup homogen-name='Gregorian' homogen-type='inherit'> + <inherit name='Gregorian'><classname resolved='predef::Calendar.Gregorian'>Gregorian</classname></inherit> + </docgroup> + </module> + <module name='Islamic'> + <doc> + <text> + <p> +  This is the islamic calendar. Due to some sources, +  they decide the first day of the new months on a +  month-to-month basis (sightings of the new moon), +  so it's probably not <i>that</i> accurate. If +  someone can confirm (or deny) accuracy better than that, +  please contact me so I can change this statement.</p> +  + <p> It's vaugely based on rules presented in algorithms by +  Dershowitz, Reingold and Clamen, 'Calendrical Calculations'. +  It is the same that's used in Emacs calendar mode.</p> +  + <p>known bugs: +  I have currently no idea how the arabic countries +  count the week. Follow the same rules as ISO +  for now... The time is also suspicious; the *day* +  really starts at sunrise (sunset?) and not midnight, +  the hours of the day is not correct. Also don't know +  what to call years before 1 - go for "BH"; positive +  years are "AH", anno Hegirac. + </p> + </text> +  + </doc> + </module> + <module name='Julian'> + <doc> + <text> + <p> + This is the Julian calendar, conjured up by + the old Romans when their calendar were just too + wierd. It was used by the christians as so far + as the 18th century in some parts of the world. + (Especially the protestantic and orthodox parts.) + </p> + </text> + <group><note/><text> + <p>Don't confuse the <i>julian day</i> with the Julian + calendar. The former is just a linear numbering of days, + used in the Calendar module as a common unit for + absolute time.</p> + </text></group> +  + </doc> + <docgroup homogen-name='YMD' homogen-type='inherit'> + <inherit name='YMD'><classname resolved='predef::Calendar.YMD'>YMD</classname></inherit> + </docgroup> + </module> + <module name='Roman'> + <doc> + <text> + <p> + base for all Roman-kind of calendars + ie, one with years, months, weeks and days + </p> + </text> +  + </doc> + </module> + <module name='Stardate'> + <doc> + <text> + <p>This implements TNG stardates.</p> + </text> +  + </doc> + <docgroup homogen-name='create' homogen-type='method'> + <method name='create'> +  <returntype> +  <object>void </object></returntype> +  <arguments><argument name='...'><type><mixed/></type></argument> +  +  </arguments> + </method><method name='create'> +  <returntype> +  <object>void </object></returntype> +  <arguments><argument name='date'><type> +  <or><int/><float/></or></type></argument> +  +  </arguments> + </method><method name='create'> +  <returntype> +  <object>void </object></returntype> +  <arguments> +  </arguments> + </method><doc> + <text> + <p> Apart from the standard creation methods +  (julian day, etc), you can create a stardate +  from the stardate number. The length +  of the period will then be zero.</p> +  + <p> You can also omit any arguments to create now.</p> +  + <p>known bugs: +  Since the precision is limited to the float type +  of pike you can get non-precise results:</p> +  + <p> <pre> +  &gt; Calendar.Second(Calendar.Stardate.Day(Calendar.Year())); +  Result: Second(Fri 31 Dec 1999 23:59:18 CET - Sun 31 Dec 2000 23:59:18 CET) +  </pre></p> + </text> +  + </doc> + </docgroup> + <docgroup homogen-name='now' homogen-type='method'> + <method name='now'> +  <returntype> +  <object>TimeofDay </object></returntype> +  <arguments> +  </arguments> + </method><doc> + <text> + <p>Give the zero-length time period of the + current time.</p> + </text> +  + </doc> + </docgroup> + <docgroup homogen-type='method'> + <method name='number_of_seconds'> +  <returntype> +  <object>int </object></returntype> +  <arguments> +  </arguments> + </method><method name='number_of_days'> +  <returntype> +  <object>int </object></returntype> +  <arguments> +  </arguments> + </method><doc> + <text> + <p> This gives back the Gregorian/Earth/ISO number of seconds +  and number of days, for convinience and conversion to +  other calendars. + string format_long() + string format_short() + string format_vshort() +  Format the stardate tick nicely. +  <pre> +  long "-322537.312" +  short "77463.312" (w/o &gt;100000-component) +  short "7463.312" (w/o &gt;10000-component) +  </pre></p> + </text> +  + </doc> + </docgroup> + <docgroup homogen-name='tics' homogen-type='method'> + <method name='tics'> +  <returntype> +  <object>float </object></returntype> +  <arguments> +  </arguments> + </method><doc> + <text> + <p>This gives back the number of stardate tics + in the period.</p> + </text> +  + </doc> + </docgroup> + </module> + <class name='SuperTimeRange'> + <doc> + <text> + <p>This class handles the cases where you have a time + period with holes. These can be created by the + <tt>^</tt> or <tt>|</tt> operators on time ranges.</p> + </text> +  + </doc> + <docgroup homogen-name='create' homogen-type='method'> + <method name='create'> +  <returntype> +  <object>void </object></returntype> +  <arguments><argument name='parts'><type> +  <array><valuetype> +  <object resolved='predef::Calendar.TimeRange'>TimeRange</object></valuetype></array></type></argument> +  +  </arguments> + </method><doc> + <text> + <p>A SuperTimeRange must have at least two parts, + two time ranges. Otherwise, it's either not + a time period at all or a normal time period.</p> + </text> +  + </doc> + </docgroup> + <docgroup homogen-name='TimeRange' homogen-type='inherit'> + <inherit name='TimeRange'><classname resolved='predef::Calendar.TimeRange'>TimeRange</classname></inherit> + </docgroup> + <docgroup homogen-name='nulltimerange' homogen-type='constant'> + <constant name='nulltimerange'><typevalue> +  <object resolved='predef::Calendar.TimeRange'>TimeRange </object></typevalue> + </constant><doc> + <text> + <p>This represents the null time range, + which, to differ from the zero time range + (the zero-length time range), isn't placed + in time. This is the result of for instance + <ref resolved='predef::Calendar.TimeRange.`&amp;'>`&amp;</ref> between two strict non-overlapping + timeranges - no time at all.</p> +  + <p>It has a constant, <tt>is_nulltimerange</tt>, which + is non-zero. <tt>`!</tt> on this timerange is true.</p> + </text> +  + </doc> + </docgroup> + </class> + <module name='Swedish'> + <doc> + <text> + <p> + Same as the ISO calendar, + but with swedish namedays added, and + swedish is the default language.</p> +  + <p>This calendar exist only for backwards compatible + purposes. + </p> + </text> +  + </doc> + </module> + <module name='TZnames'> + <doc> + <text> + <p>This module is a mapping of the names of + all the geographical (political) + based timezones. It looks mainly like + <pre> + (["Europe":({"Stockholm","Paris",...}), +  "America":({"Chicago","Panama",...}), +  ... + ]) + </pre></p> +  + <p>It is mainly there for easy and reliable ways + of making user interfaces to select timezone.</p> +  + <p>The Posix and standard timezones (like CET, PST8PDT, etc) + are not listed.</p> + </text> +  + </doc> + </module> + <module name='Time'> + <doc> + <text> + <p> + Base for time of day in calendars, ie + calendars with hours, minutes, seconds</p> +  + <p>This module can't be used by itself, but + is inherited by other modules (<ref resolved='predef::Calendar.ISO'>ISO</ref> by <ref resolved='predef::Calendar.YMD'>YMD</ref>, + for instance).</p> + </text> +  + </doc> + <docgroup homogen-name='datetime' homogen-type='method'> + <method name='datetime'> +  <returntype> +  <object>mapping </object></returntype> +  <arguments> +  </arguments> + </method><doc> + <text> + <p>This gives back a mapping with the relevant + time information (representing the start of the period); + <pre> +  ([ "year": int // year number (2000 AD=2000, 1 BC==0) +  "month": int(1..) // month of year +  "day": int(1..) // day of month +  "yearday": int(1..) // day of year +  "week": int(1..) // week of year +  "week_day": int(1..) // day of week (depending on calendar) +  +  "hour": int(0..) // hour of day, including dst +  "minute": int(0..59) // minute of hour +  "second": int(0..59) // second of minute +  "fraction": float // fraction of second +  "timezone": int // offset to utc, including dst +  +  "unix": int // unix time +  "julian": float // julian day +  ]); + </pre></p> + </text> +  + </doc> + </docgroup> + <docgroup homogen-type='method'> + <method name='format_iso_ymd'> +  <returntype> +  <object>string </object></returntype> +  <arguments> +  </arguments> + </method><method name='format_ymd'> +  <returntype> +  <object>string </object></returntype> +  <arguments> +  </arguments> + </method><method name='format_ymd_short'> +  <returntype> +  <object>string </object></returntype> +  <arguments> +  </arguments> + </method><method name='format_ymd_xshort'> +  <returntype> +  <object>string </object></returntype> +  <arguments> +  </arguments> + </method><method name='format_iso_week'> +  <returntype> +  <object>string </object></returntype> +  <arguments> +  </arguments> + </method><method name='format_iso_week_short'> +  <returntype> +  <object>string </object></returntype> +  <arguments> +  </arguments> + </method><method name='format_week'> +  <returntype> +  <object>string </object></returntype> +  <arguments> +  </arguments> + </method><method name='format_week_short'> +  <returntype> +  <object>string </object></returntype> +  <arguments> +  </arguments> + </method><method name='format_month'> +  <returntype> +  <object>string </object></returntype> +  <arguments> +  </arguments> + </method><method name='format_month_short'> +  <returntype> +  <object>string </object></returntype> +  <arguments> +  </arguments> + </method><method name='format_iso_time'> +  <returntype> +  <object>string </object></returntype> +  <arguments> +  </arguments> + </method><method name='format_time'> +  <returntype> +  <object>string </object></returntype> +  <arguments> +  </arguments> + </method><method name='format_time_short'> +  <returntype> +  <object>string </object></returntype> +  <arguments> +  </arguments> + </method><method name='format_time_xshort'> +  <returntype> +  <object>string </object></returntype> +  <arguments> +  </arguments> + </method><method name='format_mtime'> +  <returntype> +  <object>string </object></returntype> +  <arguments> +  </arguments> + </method><method name='format_xtime'> +  <returntype> +  <object>string </object></returntype> +  <arguments> +  </arguments> + </method><method name='format_tod'> +  <returntype> +  <object>string </object></returntype> +  <arguments> +  </arguments> + </method><method name='format_xtod'> +  <returntype> +  <object>string </object></returntype> +  <arguments> +  </arguments> + </method><method name='format_mod'> +  <returntype> +  <object>string </object></returntype> +  <arguments> +  </arguments> + </method><doc> + <text> + <p>Format the object into nice strings; + <pre> + iso_ymd "2000-06-02 (Jun) -W22-5 (Fri)" [2] + ext_ymd "Friday, 2 June 2000" [2] + ymd "2000-06-02" + ymd_short "20000602" + ymd_xshort "000602" [1] + iso_week "2000-W22" + iso_week_short "2000W22" + week "2000-w22" [2] + week_short "2000w22" [2] + month "2000-06" + month_short "200006" [1] + iso_time "2000-06-02 (Jun) -W22-5 (Fri) 20:53:14 UTC+1" [2] + ext_time "Friday, 2 June 2000, 20:53:14" [2] + ctime "Fri Jun 4 20:53:14 2000\n" [2] [3] + http "Fri, 02 Jun 2000 20:53:14 GMT" [4] + time "2000-06-02 20:53:14" + time_short "20000602 20:53:14" + time_xshort "000602 20:53:14" + mtime "2000-06-02 20:53" + xtime "2000-06-02 20:53:14.000000" + todz "20:53:14 CET" + todz_iso "20:53:14 UTC+1" + tod "20:53:14" + tod_short "205314" + xtod "20:53:14.000000" + mod "20:53" + </pre> + <tt>[1]</tt> note conflict (think 1 February 2003) + <br/><tt>[2]</tt> language dependent + <br/><tt>[3]</tt> as from the libc function ctime() + <br/><tt>[4]</tt> as specified by the HTTP standard; + this is always in GMT, ie, UTC. The timezone calculations + needed will be executed implicitly. It is not language + dependent.</p> + </text> +  + </doc> + </docgroup> + <class name='Fraction'> + <doc> + <text> + <p>A Fraction is a part of a second, and/or a time period + with higher resolution then a second.</p> +  + <p>It contains everything that is possible to do with a + <ref resolved='predef::Calendar.Time.Second'>Second</ref>, and also some methods of grabbing + the time period with higher resolution. + </p> + </text> + <group><note/><text> + <p>Internally, the fraction time period is measured in + nanoseconds. A shorter or more precise time period then + in nanoseconds is not possible within the current Fraction class. + </p> + </text></group> +  + </doc> + <docgroup homogen-name='create' homogen-type='method'> + <method name='create'> +  <returntype> +  <object>void </object></returntype> +  <arguments> +  </arguments> + </method><method name='create'> +  <returntype> +  <object>void </object></returntype> +  <arguments><argument><value>"unixtime"</value></argument><argument name='unixtime'><type> +  <or><int/><float/></or></type></argument> +  +  </arguments> + </method><method name='create'> +  <returntype> +  <object>void </object></returntype> +  <arguments><argument><value>"unixtime"</value></argument><argument name='unixtime'><type> +  <or><int/><float/></or></type></argument> + <argument name='len'><type> +  <or><int/><float/></or></type></argument> +  +  </arguments> + </method><doc> + <text> + <p>It is possible to create a Fraction in two ways, + either "now" with no arguments or + from a unix time (as from <tt>time(2)</tt>).</p> +  + <p>If created from unix time, both the start of the period + and the size of the period can be given in floats, + both representing seconds. Note that the default + float precision in pike is rather low (same as 'float' in C, + the 32 bit floating point precision, normally about 7 digits), + so beware that the resolution might bite you. (Internally + in a Fraction, the representation is an integer.)</p> +  + <p>If created without explicit length, the fraction will always be + of zero length.</p> + </text> +  + </doc> + </docgroup> + <docgroup homogen-name='TimeofDay' homogen-type='inherit'> + <inherit name='TimeofDay'><classname>TimeofDay</classname></inherit> + </docgroup> + <docgroup homogen-name='now' homogen-type='method'> + <method name='now'> +  <returntype> +  <object>TimeofDay </object></returntype> +  <arguments> +  </arguments> + </method><doc> + <text> + <p>Give the zero-length time period of the + current time.</p> + </text> +  + </doc> + </docgroup> + <docgroup homogen-type='method'> + <method name='set_ruleset'> +  <returntype> +  <object resolved='predef::Calendar.Calendar'>Calendar </object></returntype> +  <arguments><argument name='r'><type> +  <object>Ruleset</object></type></argument> +  +  </arguments> + </method><method name='ruleset'> +  <returntype> +  <object>Ruleset </object></returntype> +  <arguments> +  </arguments> + </method><doc> + <text> + <p>Set or read the ruleset for the calendar. + <ref resolved='predef::Calendar.Time.Fraction.set_ruleset'>set_ruleset</ref> returns a new calendar object, + but with the new ruleset.</p> + </text> +  + </doc> + </docgroup> + <docgroup homogen-type='method'> + <method name='set_timezone'> +  <returntype> +  <object resolved='predef::Calendar.Calendar'>Calendar </object></returntype> +  <arguments><argument name='tz'><type> +  <object resolved='predef::Calendar.Timezone'>Timezone</object></type></argument> +  +  </arguments> + </method><method name='set_timezone'> +  <returntype> +  <object resolved='predef::Calendar.Calendar'>Calendar </object></returntype> +  <arguments><argument name='tz'><type> +  <or><string/><object resolved='predef::Calendar.Timezone'>Timezone</object></or></type></argument> +  +  </arguments> + </method><method name='timezone'> +  <returntype> +  <object>TimeZone </object></returntype> +  <arguments> +  </arguments> + </method><doc> + <text> + <p>Set or get the current timezone (including dst) rule. + <ref resolved='predef::Calendar.Time.Fraction.set_timezone'>set_timezone</ref> returns a new calendar object, + as the called calendar but with another set of rules.</p> +  + <p>Example: + <pre> + &gt; Calendar.now(); + Result: Fraction(Fri 2 Jun 2000 18:03:22.010300 CET) + &gt; Calendar.set_timezone(Calendar.Timezone.UTC)-&gt;now(); + Result: Fraction(Fri 2 Jun 2000 16:03:02.323912 UTC) + </pre></p> + </text> +  + </doc> + </docgroup> + </class> + <class name='Hour'> + <docgroup homogen-name='TimeofDay' homogen-type='inherit'> + <inherit name='TimeofDay'><classname>TimeofDay</classname></inherit> + </docgroup> + </class> + <class name='Minute'> + <docgroup homogen-name='TimeofDay' homogen-type='inherit'> + <inherit name='TimeofDay'><classname>TimeofDay</classname></inherit> + </docgroup> + </class> + <class name='Second'> + <docgroup homogen-name='TimeofDay' homogen-type='inherit'> + <inherit name='TimeofDay'><classname>TimeofDay</classname></inherit> + </docgroup> + </class> + <class name='SuperTimeRange'> + <docgroup homogen-type='method'> + <method name='second'> +  <returntype> +  <object resolved='predef::Calendar.Time.Second'>Second </object></returntype> +  <arguments> +  </arguments> + </method><method name='second'> +  <returntype> +  <object resolved='predef::Calendar.Time.Second'>Second </object></returntype> +  <arguments><argument name='n'><type><int/></type></argument> +  +  </arguments> + </method><method name='seconds'> +  <returntype> +  <array><valuetype> +  <object resolved='predef::Calendar.Time.Second'>Second</object></valuetype></array></returntype> +  <arguments> +  </arguments> + </method><method name='seconds'> +  <returntype> +  <array><valuetype> +  <object resolved='predef::Calendar.Time.Second'>Second</object></valuetype></array></returntype> +  <arguments><argument name='first'><type><int/></type></argument> + <argument name='last'><type><int/></type></argument> +  +  </arguments> + </method><method name='number_of_seconds'> +  <returntype> +  <object>int </object></returntype> +  <arguments> +  </arguments> + </method><method name='minute'> +  <returntype> +  <object resolved='predef::Calendar.Time.Minute'>Minute </object></returntype> +  <arguments> +  </arguments> + </method><method name='minute'> +  <returntype> +  <object resolved='predef::Calendar.Time.Minute'>Minute </object></returntype> +  <arguments><argument name='n'><type><int/></type></argument> +  +  </arguments> + </method><method name='minutes'> +  <returntype> +  <array><valuetype> +  <object resolved='predef::Calendar.Time.Minute'>Minute</object></valuetype></array></returntype> +  <arguments> +  </arguments> + </method><method name='minutes'> +  <returntype> +  <array><valuetype> +  <object resolved='predef::Calendar.Time.Minute'>Minute</object></valuetype></array></returntype> +  <arguments><argument name='first'><type><int/></type></argument> + <argument name='last'><type><int/></type></argument> +  +  </arguments> + </method><method name='number_of_minutes'> +  <returntype> +  <object>int </object></returntype> +  <arguments> +  </arguments> + </method><method name='hour'> +  <returntype> +  <object resolved='predef::Calendar.Time.Hour'>Hour </object></returntype> +  <arguments> +  </arguments> + </method><method name='hour'> +  <returntype> +  <object resolved='predef::Calendar.Time.Hour'>Hour </object></returntype> +  <arguments><argument name='n'><type><int/></type></argument> +  +  </arguments> + </method><method name='hours'> +  <returntype> +  <array><valuetype> +  <object resolved='predef::Calendar.Time.Hour'>Hour</object></valuetype></array></returntype> +  <arguments> +  </arguments> + </method><method name='hours'> +  <returntype> +  <array><valuetype> +  <object resolved='predef::Calendar.Time.Hour'>Hour</object></valuetype></array></returntype> +  <arguments><argument name='first'><type><int/></type></argument> + <argument name='last'><type><int/></type></argument> +  +  </arguments> + </method><method name='number_of_hours'> +  <returntype> +  <object>int </object></returntype> +  <arguments> +  </arguments> + </method><doc> + <text> + <p>Similar to <ref>TimeofDay</ref>, the Time::SuperTimeRange + has a number of methods for digging out time parts of the + range. Since a <ref resolved='predef::Calendar.Time.SuperTimeRange'>SuperTimeRange</ref> is a bit more + complex - the major reason for its existance it that it + contains holes, this calculation is a bit more advanced too.</p> +  + <p>If a range contains the seconds, say, 1..2 and 4..5, + the third second (number 2, since we start from 0) + in the range would be number 4, like this:</p> +  + <p><pre> + no means this second + 0 1 + 1 2 + 2 4 &lt;- second three is missing, + 3 5 as we don't have it in the example range + </pre></p> +  + <p><ref resolved='predef::Calendar.Time.SuperTimeRange.number_of_seconds'>number_of_seconds</ref>() will in this example + therefore also report 4, not 5, even if the time from + start of the range to the end of the range is 5 seconds. + </p> + </text> +  + </doc> + </docgroup> + <docgroup homogen-name='SuperTimeRange' homogen-type='inherit'> + <inherit name='SuperTimeRange'><classname>TimeRanges.SuperTimeRange</classname></inherit> + </docgroup> + </class> + <class name='TimeOfDay'> + <docgroup homogen-name='create' homogen-type='method'> + <method name='create'> +  <returntype> +  <object>void </object></returntype> +  <arguments> +  </arguments> + </method><method name='create'> +  <returntype> +  <object>void </object></returntype> +  <arguments><argument name='unixtime'><type><int/></type></argument> +  +  </arguments> + </method><doc> + <text> + <p>In addition to the wide range of construction arguments + for a normal TimeRange (see <ref resolved='predef::Calendar.TimeRange.create'>TimeRange.create</ref>), + a time of day can also be constructed with unixtime + as single argument consisting of the unix time + - as returned from <tt>time(2)</tt> - of the time unit start.</p> +  + <p>It can also be constructed without argument, which + then means "now", as in "this minute".</p> + </text> +  + </doc> + </docgroup> + <docgroup homogen-type='method'> + <method name='hour_no'> +  <returntype> +  <object>int </object></returntype> +  <arguments> +  </arguments> + </method><method name='minute_no'> +  <returntype> +  <object>int </object></returntype> +  <arguments> +  </arguments> + </method><method name='second_no'> +  <returntype> +  <object>int </object></returntype> +  <arguments> +  </arguments> + </method><method name='fraction_no'> +  <returntype> +  <object>float </object></returntype> +  <arguments> +  </arguments> + </method><doc> + <text> + <p>This gives back the number of the time unit, + on this day. Fraction is a float number, 0&lt;=fraction&lt;1.</p> + </text> +  + </doc> + </docgroup> + <docgroup homogen-type='method'> + <method name='hour'> +  <returntype> +  <object resolved='predef::Calendar.Time.Hour'>Hour </object></returntype> +  <arguments> +  </arguments> + </method><method name='hour'> +  <returntype> +  <object resolved='predef::Calendar.Time.Hour'>Hour </object></returntype> +  <arguments><argument name='n'><type><int/></type></argument> +  +  </arguments> + </method><method name='hours'> +  <returntype> +  <array><valuetype> +  <object resolved='predef::Calendar.Time.Hour'>Hour</object></valuetype></array></returntype> +  <arguments> +  </arguments> + </method><method name='hours'> +  <returntype> +  <array><valuetype> +  <object resolved='predef::Calendar.Time.Hour'>Hour</object></valuetype></array></returntype> +  <arguments><argument name='first'><type><int/></type></argument> + <argument name='last'><type><int/></type></argument> +  +  </arguments> + </method><method name='number_of_hours'> +  <returntype> +  <object>int </object></returntype> +  <arguments> +  </arguments> + </method><doc> + <text> + <p> <ref resolved='predef::Calendar.Time.TimeOfDay.hour'>hour</ref>() gives back the timerange representing the +  first or <i>n</i>th Hour of the called object. +  Note that hours normally starts to count at zero, +  so <tt>-&gt;hour(2)</tt> gives the third hour within +  the range.</p> +  + <p> An Hour is in the Calendar perspective as any other +  time range not only 60 minutes, but also one +  of the (normally) 24 hours of the day, precisely.</p> +  + <p> <ref resolved='predef::Calendar.Time.TimeOfDay.hours'>hours</ref>() give back an array of all the hours +  containing the time periods called. With arguments, +  it will give back a range of those hours, in the +  same enumeration as the <i>n</i> to <ref resolved='predef::Calendar.Time.TimeOfDay.hour'>hour</ref>().</p> +  + <p> <ref resolved='predef::Calendar.Time.TimeOfDay.number_of_hours'>number_of_hours</ref>() simple counts the +  number of hours containing the called time period.</p> +  + <p>Note: +  The called object doesn't have to +  *fill* all the hours it will send back, it's +  enough if it exist in those hours:</p> +  + <p> <pre> +  &gt; object h=Calendar.Time.Hour(); +  Result: Hour(265567) +  &gt; h-&gt;hours(); +  Result: ({ /* 1 element */ +  Hour(265567) +  }) +  &gt; h+=Calendar.Time.Minute(); +  Result: Minute(265567:01+60m) +  &gt; h-&gt;hours(); +  Result: ({ /* 2 elements */ +  Hour(265567), +  Hour(265568) +  }) +  </pre></p> + </text> +  + </doc> + </docgroup> + <docgroup homogen-name='TimeRange' homogen-type='inherit'> + <inherit name='TimeRange'><classname resolved='predef::Calendar.TimeRange'>TimeRange</classname></inherit> + </docgroup> + <docgroup homogen-name='julian_day' homogen-type='method'> + <method name='julian_day'> +  <returntype> +  <object>float </object></returntype> +  <arguments> +  </arguments> + </method><doc> + <text> + <p>This calculates the corresponding julian day, + from the time range. Note that the calculated day + is the beginning of the period, and is a float - + julian day standard says .00 is midday, 12:00 pm. + </p> + </text> + <group><note/><text> + <p>Normal pike (ie, 32 bit) floats (without --with-double-precision) + has a limit of about 7 digits, and since we are about + julian day 2500000, the precision on time of day is very limited.</p> + </text></group> +  + </doc> + </docgroup> + <docgroup homogen-type='method'> + <method name='minute'> +  <returntype> +  <object resolved='predef::Calendar.Time.Minute'>Minute </object></returntype> +  <arguments> +  </arguments> + </method><method name='minute'> +  <returntype> +  <object resolved='predef::Calendar.Time.Minute'>Minute </object></returntype> +  <arguments><argument name='n'><type><int/></type></argument> +  +  </arguments> + </method><method name='minutes'> +  <returntype> +  <array><valuetype> +  <object resolved='predef::Calendar.Time.Minute'>Minute</object></valuetype></array></returntype> +  <arguments> +  </arguments> + </method><method name='minutes'> +  <returntype> +  <array><valuetype> +  <object resolved='predef::Calendar.Time.Minute'>Minute</object></valuetype></array></returntype> +  <arguments><argument name='first'><type><int/></type></argument> + <argument name='last'><type><int/></type></argument> +  +  </arguments> + </method><method name='number_of_minutes'> +  <returntype> +  <object>int </object></returntype> +  <arguments> +  </arguments> + </method><doc> + <text> + <p><ref resolved='predef::Calendar.Time.TimeOfDay.minute'>minute</ref>() gives back the timerange representing the + first or <i>n</i>th Minute of the called object. + Note that minutes normally starts to count at zero, + so <tt>-&gt;minute(2)</tt> gives the third minute within + the range.</p> +  + <p>An Minute is in the Calendar perspective as any other + time range not only 60 seconds, but also one + of the (normally) 60 minutes of the <ref resolved='predef::Calendar.Time.Hour'>Hour</ref>, precisely.</p> +  + <p><ref resolved='predef::Calendar.Time.TimeOfDay.minutes'>minutes</ref>() give back an array of all the minutes + containing the time periods called. With arguments, + it will give back a range of those minutes, in the + same enumeration as the <i>n</i> to <ref resolved='predef::Calendar.Time.TimeOfDay.minute'>minute</ref>().</p> +  + <p><ref resolved='predef::Calendar.Time.TimeOfDay.number_of_minutes'>number_of_minutes</ref>() simple counts the + number of minutes containing the called time period. + </p> + </text> +  + </doc> + </docgroup> + <docgroup homogen-type='method'> + <method name='move_seconds'> +  <returntype> +  <object resolved='predef::Calendar.TimeRange'>TimeRange </object></returntype> +  <arguments><argument name='seconds'><type><int/></type></argument> +  +  </arguments> + </method><method name='move_ns'> +  <returntype> +  <object resolved='predef::Calendar.TimeRange'>TimeRange </object></returntype> +  <arguments><argument name='nanoseconds'><type><int/></type></argument> +  +  </arguments> + </method><doc> + <text> + <p>These two methods gives back the + time range called moved the specified + amount of time, with the length intact.</p> +  + <p>The motion is relative to the original position + in time; 10 seconds ahead of 10:42:32 is 10:42:42, etc.</p> + </text> +  + </doc> + </docgroup> + <docgroup homogen-type='method'> + <method name='second'> +  <returntype> +  <object resolved='predef::Calendar.Time.Second'>Second </object></returntype> +  <arguments> +  </arguments> + </method><method name='second'> +  <returntype> +  <object resolved='predef::Calendar.Time.Second'>Second </object></returntype> +  <arguments><argument name='n'><type><int/></type></argument> +  +  </arguments> + </method><method name='seconds'> +  <returntype> +  <array><valuetype> +  <object resolved='predef::Calendar.Time.Second'>Second</object></valuetype></array></returntype> +  <arguments> +  </arguments> + </method><method name='seconds'> +  <returntype> +  <array><valuetype> +  <object resolved='predef::Calendar.Time.Second'>Second</object></valuetype></array></returntype> +  <arguments><argument name='first'><type><int/></type></argument> + <argument name='last'><type><int/></type></argument> +  +  </arguments> + </method><method name='number_of_seconds'> +  <returntype> +  <object>int </object></returntype> +  <arguments> +  </arguments> + </method><doc> + <text> + <p><ref resolved='predef::Calendar.Time.TimeOfDay.second'>second</ref>() gives back the timerange representing the + first or <i>n</i>th Second of the called object. + Note that seconds normally starts to count at zero, + so <tt>-&gt;second(2)</tt> gives the third second within + the range.</p> +  + <p><ref resolved='predef::Calendar.Time.TimeOfDay.seconds'>seconds</ref>() give back an array of all the seconds + containing the time periods called. With arguments, + it will give back a range of those seconds, in the + same enumeration as the <i>n</i> to <ref resolved='predef::Calendar.Time.TimeOfDay.second'>second</ref>().</p> +  + <p><ref resolved='predef::Calendar.Time.TimeOfDay.number_of_seconds'>number_of_seconds</ref>() simple counts the + number of seconds containing the called time period.</p> + </text> +  + </doc> + </docgroup> + <docgroup homogen-type='method'> + <method name='set_size_seconds'> +  <returntype> +  <object resolved='predef::Calendar.TimeRange'>TimeRange </object></returntype> +  <arguments><argument name='seconds'><type><int/></type></argument> +  +  </arguments> + </method><method name='set_size_ns'> +  <returntype> +  <object resolved='predef::Calendar.TimeRange'>TimeRange </object></returntype> +  <arguments><argument name='nanoseconds'><type><int/></type></argument> +  +  </arguments> + </method><doc> + <text> + <p>These two methods allows the time range + to be edited by size of specific units.</p> + </text> +  + </doc> + </docgroup> + <docgroup homogen-name='unix_time' homogen-type='method'> + <method name='unix_time'> +  <returntype> +  <object>int </object></returntype> +  <arguments> +  </arguments> + </method><doc> + <text> + <p>This calculates the corresponding unix time, + - as returned from <tt>time(2)</tt> - from the + time range. Note that the calculated unix time + is the beginning of the period.</p> + </text> +  + </doc> + </docgroup> + </class> + </module> + <class name='TimeRange'> + <doc> + <text> + <p>This is the base class for any time measurement + and calendrar information. It defines all the + things you can do with a time range, any time + period.</p> +  + <p>A TimeRange doubles as both a fixed period in + time, and an amount of time. For instance, + a week plus a day moves the week-period one day + ahead (unaligning it with the week period, + and thereby reducing it to just 7 days), + no matter when in time the actual day were. + </p> + </text> +  + </doc> + <docgroup homogen-type='method'> + <method name='`=='> +  <returntype> +  <int><min>0</min><max>1</max></int></returntype> +  <arguments><argument name='compared_to'><type> +  <object resolved='predef::Calendar.TimeRange'>TimeRange</object></type></argument> +  +  </arguments> + </method><method name='_equal'> +  <returntype> +  <int><min>0</min><max>1</max></int></returntype> +  <arguments><argument name='compared_to'><type> +  <object resolved='predef::Calendar.TimeRange'>TimeRange</object></type></argument> +  +  </arguments> + </method><doc> + <text> + <p> These two overloads the operator <tt>`==</tt> and +  the result of the <tt>equal</tt> function.</p> +  + <p> a<tt>==</tt>b is considered true if the two +  timeranges are of the same type, have the same rules +  (language, timezone, etc) and are the same timerange.</p> +  + <p> <tt>equal(</tt>a<tt>,</tt>b<tt>)</tt> are considered +  true if a and b are the same timerange, exactly the same +  as the <ref resolved='predef::Calendar.TimeRange.equals'>equals</ref> method.</p> +  + <p> The <tt>__hash</tt> method is also present, +  to make timeranges possible to use as keys in mappings.</p> +  + <p>known bugs: +  _equal is not currently possible to overload, +  due to wierd bugs, so equal uses `== for now.</p> + </text> +  + </doc> + </docgroup> + <docgroup homogen-name='`&amp;' homogen-type='method'> + <method name='`&amp;'> +  <returntype> +  <object resolved='predef::Calendar.TimeRange'>TimeRange </object></returntype> +  <arguments><argument name='with'><type> +  <object resolved='predef::Calendar.TimeRange'>TimeRange</object></type></argument> +  +  </arguments> + </method><doc> + <text> + <p> Gives the cut on the called time period +  with another time period. The result is +  zero if the two periods doesn't overlap. +  <pre> + &gt;- the past the future -&lt; +  |-------called-------| +  |-------other--------| +  &gt;----- cut -----&lt; +  </pre></p> + </text> +  + </doc> + </docgroup> + <docgroup homogen-name='`*' homogen-type='method'> + <method name='`*'> +  <returntype> +  <object resolved='predef::Calendar.TimeRange'>TimeRange </object></returntype> +  <arguments><argument name='n'><type><int/></type></argument> +  +  </arguments> + </method><doc> + <text> + <p>This changes the amount of time in + the time period. <tt>t*17</tt> is + the same as doing <tt>t-&gt;<ref resolved='predef::Calendar.TimeRange.set_size'>set_size</ref>(t,17)</tt>.</p> + </text> +  + </doc> + </docgroup> + <docgroup homogen-type='method'> + <method name='`+'> +  <returntype> +  <object resolved='predef::Calendar.TimeRange'>TimeRange </object></returntype> +  <arguments><argument name='n'><type><int/></type></argument> +  +  </arguments> + </method><method name='`+'> +  <returntype> +  <object resolved='predef::Calendar.TimeRange'>TimeRange </object></returntype> +  <arguments><argument name='offset'><type> +  <object resolved='predef::Calendar.TimeRange'>TimeRange</object></type></argument> +  +  </arguments> + </method><method name='`-'> +  <returntype> +  <object resolved='predef::Calendar.TimeRange'>TimeRange </object></returntype> +  <arguments><argument name='m'><type><int/></type></argument> +  +  </arguments> + </method><method name='`-'> +  <returntype> +  <object resolved='predef::Calendar.TimeRange'>TimeRange </object></returntype> +  <arguments><argument name='x'><type> +  <object resolved='predef::Calendar.TimeRange'>TimeRange</object></type></argument> +  +  </arguments> + </method><doc> + <text> + <p>This calculates the (promoted) time period + either n step away or with a given offset. + These functions does use <ref resolved='predef::Calendar.TimeRange.add'>add</ref> to really + do the job: + <pre> + t+n t-&gt;add(n) t is a time period + t-n t-&gt;add(-n) offset is a time period + t+offset t-&gt;add(1,offset) n is an integer + t-offset t-&gt;add(-1,offset) + n+t t-&gt;add(n) + n-t illegal + offset+t offset-&gt;add(1,t) | note this! + offset-t offset-&gt;add(-1,t) | + </pre></p> +  + <p>Mathematic rules: + <pre> + x+(t-x) == t x is an integer or a time period + (x+t)-x == t t is a time period + (t+x)-x == t + o-(o-t) == t o is a time period + t++ == t+1 + t-- == t-1 + </pre> + </p> + </text> + <group><note/><text> + <p>a-b does not give the distance between the start of a and b. + Use the <ref resolved='predef::Calendar.TimeRange.distance'>distance</ref>() function to calculate that.</p> +  + <p>The integer used to `+, `- and add are the <i>number</i> + of steps the motion will be. It does <i>never</i> represent + any <i>fixed</i> amount of time, like seconds or days.</p> + </text></group> +  + </doc> + </docgroup> + <docgroup homogen-type='method'> + <method name='`/'> +  <returntype> +  <array><valuetype> +  <object resolved='predef::Calendar.TimeRange'>TimeRange</object></valuetype></array></returntype> +  <arguments><argument name='n'><type><int/></type></argument> +  +  </arguments> + </method><method name='split'> +  <returntype> +  <array><valuetype> +  <object resolved='predef::Calendar.TimeRange'>TimeRange</object></valuetype></array></returntype> +  <arguments><argument name='n'><type><int/></type></argument> +  +  </arguments> + </method><doc> + <text> + <p> This divides the called timerange into +  n pieces. The returned timerange type +  is not neccesarily of the same type as the called one.</p> +  + <p>known bugs: +  These are currently not defined for +  <ref to='supertimerange'>supertimeranges</ref>.</p> + </text> +  + </doc> + </docgroup> + <docgroup homogen-type='method'> + <method name='`/'> +  <returntype> +  <object>int </object></returntype> +  <arguments><argument name='with'><type> +  <object resolved='predef::Calendar.TimeRange'>TimeRange</object></type></argument> +  +  </arguments> + </method><method name='how_many'> +  <returntype> +  <object>int </object></returntype> +  <arguments><argument name='with'><type> +  <object resolved='predef::Calendar.TimeRange'>TimeRange</object></type></argument> +  +  </arguments> + </method><doc> + <text> + <p>This calculates how many instances of the given + timerange has passed during the called timerange.</p> +  + <p>For instance, to figure out your age, + create the timerange of your lifespan, and divide + with the instance of a <ref to='ymd.year'>Year</ref>.</p> + </text> +  + </doc> + </docgroup> + <docgroup homogen-type='method'> + <method name='`&lt;'> +  <returntype> +  <int><min>0</min><max>1</max></int></returntype> +  <arguments><argument name='compared_to'><type> +  <object resolved='predef::Calendar.TimeRange'>TimeRange</object></type></argument> +  +  </arguments> + </method><method name='`&gt;'> +  <returntype> +  <int><min>0</min><max>1</max></int></returntype> +  <arguments><argument name='compared_to'><type> +  <object resolved='predef::Calendar.TimeRange'>TimeRange</object></type></argument> +  +  </arguments> + </method><doc> + <text> + <p>These operators sorts roughty on the + periods place in time. The major use + might be to get multiset to work, + besides sorting events clearly defined in time.</p> + </text> +  + </doc> + </docgroup> + <docgroup homogen-name='`^' homogen-type='method'> + <method name='`^'> +  <returntype> +  <object resolved='predef::Calendar.TimeRange'>TimeRange </object></returntype> +  <arguments><argument name='with'><type> +  <object resolved='predef::Calendar.TimeRange'>TimeRange</object></type></argument> +  +  </arguments> + </method><doc> + <text> + <p> Gives the exclusive-or on the called time period +  and another time period, ie the union without +  the cut. The result is zero if the +  two periods were the same. +  <pre> + &gt;- the past the future -&lt; +  |-------called-------| +  |-------other--------| +  &lt;----| |----&gt; - exclusive or +  </pre></p> + </text> +  + </doc> + </docgroup> + <docgroup homogen-name='`|' homogen-type='method'> + <method name='`|'> +  <returntype> +  <object resolved='predef::Calendar.TimeRange'>TimeRange </object></returntype> +  <arguments><argument name='with'><type> +  <object resolved='predef::Calendar.TimeRange'>TimeRange</object></type></argument> +  +  </arguments> + </method><doc> + <text> + <p> Gives the union on the called time period +  and another time period. +  <pre> + &gt;- the past the future -&lt; +  |-------called-------| +  |-------other--------| +  &lt;----------union----------&gt; +  </pre></p> + </text> +  + </doc> + </docgroup> + <docgroup homogen-name='add' homogen-type='method'> + <method name='add'> +  <returntype> +  <object resolved='predef::Calendar.TimeRange'>TimeRange </object></returntype> +  <arguments><argument name='n'><type><int/></type></argument> + <argument name='step'><type> +  <or><void/><object resolved='predef::Calendar.TimeRange'>TimeRange</object></or></type></argument> +  +  </arguments> + </method><doc> + <text> + <p>calculates the (promoted) time period n steps away; + if no step is given, the step's length is of the + same length as the called time period.</p> +  + <p>It is not recommended to loop by adding the increment + time period to a shorter period; this can cause faults, + if the shorter time period doesn't exist in the incremented + period. (Like week 53, day 31 of a month or the leap day of a year.)</p> +  + <p>Recommended use are like this: + <pre> +  // loop over the 5th of the next 10 months +  TimeRange month=Month()+1; +  TimeRange orig_day=month()-&gt;day(5); +  for (int i=0; i&lt;10; i++) +  { +  month++; +  TimeRange day=month-&gt;place(orig_day); +  &lt;i&gt;...use day...&lt;/i&gt; +  } + </pre></p> + </text> +  + </doc> + </docgroup> + <docgroup homogen-type='method'> + <method name='beginning'> +  <returntype> +  <object resolved='predef::Calendar.TimeRange'>TimeRange </object></returntype> +  <arguments> +  </arguments> + </method><method name='end'> +  <returntype> +  <object resolved='predef::Calendar.TimeRange'>TimeRange </object></returntype> +  <arguments> +  </arguments> + </method><doc> + <text> + <p>This gives back the zero-sized beginning + or end of the called time period.</p> +  + <p>rule: + <tt>range(t-&gt;beginning(),t-&gt;end())==t</tt></p> + </text> +  + </doc> + </docgroup> + <docgroup homogen-name='calendar' homogen-type='method'> + <method name='calendar'> +  <returntype> +  <object resolved='predef::Calendar.Calendar'>Calendar </object></returntype> +  <arguments> +  </arguments> + </method><doc> + <text> + <p>Simply gives back the calendar in use, for instance + Calendar.ISO or Calendar.Discordian. + </p> + </text> +  + </doc> + </docgroup> + <docgroup homogen-type='method'> + <method name='strictly_preceeds'> +  <returntype> +  <int><min>0</min><max>1</max></int></returntype> +  <arguments><argument name='what'><type> +  <object resolved='predef::Calendar.TimeRange'>TimeRange</object></type></argument> +  +  </arguments> + </method><method name='preceeds'> +  <returntype> +  <int><min>0</min><max>1</max></int></returntype> +  <arguments><argument name='what'><type> +  <object resolved='predef::Calendar.TimeRange'>TimeRange</object></type></argument> +  +  </arguments> + </method><method name='is_previous_to'> +  <returntype> +  <int><min>0</min><max>1</max></int></returntype> +  <arguments><argument name='what'><type> +  <object resolved='predef::Calendar.TimeRange'>TimeRange</object></type></argument> +  +  </arguments> + </method><method name='overlaps'> +  <returntype> +  <int><min>0</min><max>1</max></int></returntype> +  <arguments><argument name='what'><type> +  <object resolved='predef::Calendar.TimeRange'>TimeRange</object></type></argument> +  +  </arguments> + </method><method name='contains'> +  <returntype> +  <int><min>0</min><max>1</max></int></returntype> +  <arguments><argument name='what'><type> +  <object resolved='predef::Calendar.TimeRange'>TimeRange</object></type></argument> +  +  </arguments> + </method><method name='equals'> +  <returntype> +  <int><min>0</min><max>1</max></int></returntype> +  <arguments><argument name='what'><type> +  <object resolved='predef::Calendar.TimeRange'>TimeRange</object></type></argument> +  +  </arguments> + </method><method name='is_next_to'> +  <returntype> +  <int><min>0</min><max>1</max></int></returntype> +  <arguments><argument name='what'><type> +  <object resolved='predef::Calendar.TimeRange'>TimeRange</object></type></argument> +  +  </arguments> + </method><method name='succeeds'> +  <returntype> +  <int><min>0</min><max>1</max></int></returntype> +  <arguments><argument name='what'><type> +  <object resolved='predef::Calendar.TimeRange'>TimeRange</object></type></argument> +  +  </arguments> + </method><method name='strictly_succeeds'> +  <returntype> +  <int><min>0</min><max>1</max></int></returntype> +  <arguments><argument name='what'><type> +  <object resolved='predef::Calendar.TimeRange'>TimeRange</object></type></argument> +  +  </arguments> + </method><doc> + <text> + <p> These methods exists to compare two periods +  of time on the timeline.</p> +  + <p><pre> +  case predicates +  +  &lt;-- past future -&gt; +  +  |----A----| A strictly preceeds B, +  |----B----| A preceeds B +  +  |----A----| A strictly preceeds B, A preceeds B, +  |----B----| A is previous to B, A touches B +  +  |----A----| A preceeds B, +  |----B----| A overlaps B, A touches B +  +  |-------A-------| A preceeds B, A ends with B +  |----B----| A overlaps B, A contains B, A touches B, +  +  |-------A-------| A preceeds B, A succeeds B, +  |---B---| A overlaps B, A contains B, A touches B +  +  |----A----| A overlaps B, A touches B +  |----B----| A equals B, A starts with B, A ends with B +  +  |-------A-------| A succeeds B, A starts with B +  |----B----| A overlaps B, A contains B, A touches B +  +  |----A----| A succeeds B, +  |----B----| A overlaps B, A touches B +  +  |----A----| A strictly succeeds B, A succeeds B +  |----B----| A is next to B, A touches B +  +  |----A----| A strictly succeeds B, +  |----B----| A succeeds B +  +  </pre></p> + </text> +  + </doc> + </docgroup> + <docgroup homogen-name='create' homogen-type='method'> + <method name='create'> +  <returntype> +  <object>void </object></returntype> +  <arguments><argument name='from'><type> +  <object resolved='predef::Calendar.TimeRange'>TimeRange</object></type></argument> +  +  </arguments> + </method><doc> + <text> + <p>Create the timerange from another timerange.</p> +  + <p>This is useful when converting objects from + one calendar to another. Note that the ruleset will be + transferred to the new object, so this method + can't be used to convert between timezones + or languges - use <ref resolved='predef::Calendar.TimeRange.set_timezone'>set_timezone</ref>, + <ref resolved='predef::Calendar.TimeRange.set_language'>set_language</ref> or <ref resolved='predef::Calendar.TimeRange.set_ruleset'>set_ruleset</ref> + to achieve this. + </p> + </text> + <group><note/><text> + <p>The size of the new object may be inexact; + a Month object can't comprehend seconds, for instance.</p> + </text></group> +  + </doc> + </docgroup> + <docgroup homogen-name='create' homogen-type='method'> + <method name='create'> +  <returntype> +  <object>void </object></returntype> +  <arguments><argument><value>"julian"</value></argument><argument name='julian_day'><type> +  <or><int/><float/></or></type></argument> +  +  </arguments> + </method><doc> + <text> + <p>Create the timerange from a julian day, the + standardized method of counting days. If + the timerange is more then a day, it will + at least enclose the day. + </p> + </text> +  + </doc> + </docgroup> + <docgroup homogen-name='create' homogen-type='method'> + <method name='create'> +  <returntype> +  <object>void </object></returntype> +  <arguments><argument><value>"unix"</value></argument><argument name='unixtime'><type><int/></type></argument> +  +  </arguments> + </method><method name='create'> +  <returntype> +  <object>void </object></returntype> +  <arguments><argument><value>"unix"</value></argument><argument name='unixtime'><type><int/></type></argument> + <argument name='seconds_len'><type><int/></type></argument> +  +  </arguments> + </method><doc> + <text> + <p>Create the timerange from unix time (as given by + <tt>time(2)</tt>), with eventually the size of + the time range in the same unit, seconds. + </p> + </text> +  + </doc> + </docgroup> + <docgroup homogen-type='method'> + <method name='range'> +  <returntype> +  <object resolved='predef::Calendar.TimeRange'>TimeRange </object></returntype> +  <arguments><argument name='other'><type> +  <object resolved='predef::Calendar.TimeRange'>TimeRange</object></type></argument> +  +  </arguments> + </method><method name='space'> +  <returntype> +  <object resolved='predef::Calendar.TimeRange'>TimeRange </object></returntype> +  <arguments><argument name='other'><type> +  <object resolved='predef::Calendar.TimeRange'>TimeRange</object></type></argument> +  +  </arguments> + </method><method name='distance'> +  <returntype> +  <object resolved='predef::Calendar.TimeRange'>TimeRange </object></returntype> +  <arguments><argument name='other'><type> +  <object resolved='predef::Calendar.TimeRange'>TimeRange</object></type></argument> +  +  </arguments> + </method><doc> + <text> + <p> Derives different time periods in between +  the called timerange and the parameter timerange.</p> +  + <p> <pre> + &gt;- the past the future -&lt; +  |--called--| |--other--| +  &gt;------------ range -----------&lt; +  &gt;--space--&lt; +  &gt;----- distance -----&lt; +  </pre></p> +  + <p> See also: add, TimeRanges.range, TimeRanges.space, TimeRanges.distance</p> + </text> +  + </doc> + </docgroup> + <docgroup homogen-type='method'> + <method name='set_language'> +  <returntype> +  <object resolved='predef::Calendar.TimeRange'>TimeRange </object></returntype> +  <arguments><argument name='lang'><type> +  <object>Language</object></type></argument> +  +  </arguments> + </method><method name='set_language'> +  <returntype> +  <object resolved='predef::Calendar.TimeRange'>TimeRange </object></returntype> +  <arguments><argument name='lang'><type><string/></type></argument> +  +  </arguments> + </method><method name='language'> +  <returntype> +  <object>Language </object></returntype> +  <arguments> +  </arguments> + </method><doc> + <text> + <p>Set or get the current language rule.</p> + </text> +  + </doc> + </docgroup> + <docgroup homogen-name='place' homogen-type='method'> + <method name='place'> +  <returntype> +  <object resolved='predef::Calendar.TimeRange'>TimeRange </object></returntype> +  <arguments><argument name='this'><type> +  <object resolved='predef::Calendar.TimeRange'>TimeRange</object></type></argument> +  +  </arguments> + </method><method name='place'> +  <returntype> +  <object resolved='predef::Calendar.TimeRange'>TimeRange </object></returntype> +  <arguments><argument name='this'><type> +  <object resolved='predef::Calendar.TimeRange'>TimeRange</object></type></argument> + <argument name='force'><type> +  <int><min>0</min><max>1</max></int></type></argument> +  +  </arguments> + </method><doc> + <text> + <p>This will place the given timerange in this timerange, + for instance, day 37 in the year - + <tt>Year(1934)-&gt;place(Day(1948 d37)) =&gt; Day(1934 d37)</tt>. + </p> + </text> + <group><note/><text> + <p>The rules how to place things in different timeranges + can be somewhat 'dwim'.</p> + </text></group> +  + </doc> + </docgroup> + <docgroup homogen-type='method'> + <method name='set_ruleset'> +  <returntype> +  <object resolved='predef::Calendar.TimeRange'>TimeRange </object></returntype> +  <arguments><argument name='r'><type> +  <object>Ruleset</object></type></argument> +  +  </arguments> + </method><method name='ruleset'> +  <returntype> +  <object resolved='predef::Calendar.TimeRange'>TimeRange </object></returntype> +  <arguments><argument name='r'><type> +  <object>Ruleset</object></type></argument> +  +  </arguments> + </method><doc> + <text> + <p>Set or get the current ruleset.</p> + </text> + <group><note/><text> + <p>this may include timezone shanges, + and change the time of day.</p> + </text></group> +  + </doc> + </docgroup> + <docgroup homogen-name='set_size' homogen-type='method'> + <method name='set_size'> +  <returntype> +  <object resolved='predef::Calendar.TimeRange'>TimeRange </object></returntype> +  <arguments><argument name='size'><type> +  <object resolved='predef::Calendar.TimeRange'>TimeRange</object></type></argument> +  +  </arguments> + </method><method name='set_size'> +  <returntype> +  <object resolved='predef::Calendar.TimeRange'>TimeRange </object></returntype> +  <arguments><argument name='n'><type><int/></type></argument> + <argument name='size'><type> +  <object resolved='predef::Calendar.TimeRange'>TimeRange</object></type></argument> +  +  </arguments> + </method><doc> + <text> + <p>Gives back a new (or the same, if the size matches) + timerange with the new size. + If <i>n</i> are given, the resulting size + will be <i>n</i> amounts of the given size.</p> + </text> + <group><note/><text> + <p>A negative size is not permitted; a zero one are.</p> + </text></group> +  + </doc> + </docgroup> + <docgroup homogen-type='method'> + <method name='set_timezone'> +  <returntype> +  <object resolved='predef::Calendar.TimeRange'>TimeRange </object></returntype> +  <arguments><argument name='tz'><type> +  <object resolved='predef::Calendar.Timezone'>Timezone</object></type></argument> +  +  </arguments> + </method><method name='set_timezone'> +  <returntype> +  <object resolved='predef::Calendar.TimeRange'>TimeRange </object></returntype> +  <arguments><argument name='tz'><type><string/></type></argument> +  +  </arguments> + </method><method name='timezone'> +  <returntype> +  <object>TimeZone </object></returntype> +  <arguments> +  </arguments> + </method><doc> + <text> + <p>Set or get the current timezone (including dst) rule. + </p> + </text> + <group><note/><text> + <p>The time-of-day may very well + change when you change timezone.</p> +  + <p>To get the time of day for a specified timezone, + select the timezone before getting the time of day:</p> +  + <p><tt>Year(2003)-&gt;...-&gt;set_timezone(TimeZone.CET)-&gt;...-&gt;hour(14)-&gt;...</tt> + </p> + </text></group> +  + </doc> + </docgroup> + <docgroup homogen-name='subtract' homogen-type='method'> + <method name='subtract'> +  <returntype> +  <object resolved='predef::Calendar.TimeRange'>TimeRange </object></returntype> +  <arguments><argument name='what'><type> +  <object resolved='predef::Calendar.TimeRange'>TimeRange</object></type></argument> +  +  </arguments> + </method><doc> + <text> + <p>This subtracts a period of time from another; + <pre> + &gt;- the past the future -&lt; + |-------called-------| +  |-------other--------| + &lt;----&gt; &lt;- called-&gt;subtract(other) +  + |-------called-------| +  |---third---| + &lt;----&gt; &lt;---&gt; &lt;- called-&gt;subtract(third) + </pre></p> + </text> +  + </doc> + </docgroup> + </class> + <module name='Timezone'> + <doc> + <text> + <p> + This module contains all the predefined timezones. + Index it with whatever timezone you want to use.</p> +  + <p>Example: + <tt>Calendar.Calendar my_cal= +  Calendar.ISO-&gt;set_timezone(Calendar.Timezone["Europe/Stockholm"]); + </tt></p> +  + <p>A simpler way of selecting timezones might be + to just give the string to + <ref to='ruleset.set_timezone'>set_timezone</ref>; + <ref to='ruleset.set_timezone'>it</ref> indexes by itself:</p> +  + <p><tt>Calendar.Calendar my_cal= +  Calendar.ISO-&gt;set_timezone("Europe/Stockholm"); + </tt> + </p> + </text> + <group><note/><text> + <p>Do not confuse this module with <ref>Ruleset.Timezone</ref>, + which is the base class of a timezone object.</p> +  + <p><tt>"CET"</tt> and some other standard abbreviations work too, + but not all of them (due to more then one country using them).</p> +  + <p>Do not call <ref to='calendar.time.set_timezone'>set_timezone</ref> + too often, but remember the result if possible. It might take + some time to initialize a timezone object.</p> +  + <p>There are about 504 timezones with 127 different daylight + saving rules. Most of them historic.</p> +  + <p>The timezone information comes from + <url href='ftp://elsie.nci.nih.gov/pub'>ftp://elsie.nci.nih.gov/pub/</url> + and are not made up from scratch. Timezone bugs may be reported + to the timezone mailing list, + <url href='mailto:tz@elsie.nci.nih.gov'>tz@elsie.nci.nih.gov</url>, + preferable with a <tt>cc</tt> to + <url href='mailto:mirar@mirar.org'>mirar@mirar.org</url>. /Mirar + </p> + </text></group> + <group><seealso/><text> + <p><ref resolved='predef::Calendar.TZnames'>TZnames</ref>, <ref>Ruleset.Timezone</ref></p></text></group> +  + </doc> + <docgroup homogen-name='locale' homogen-type='constant'> + <constant name='locale'><typevalue> +  <object>Ruleset.Timezone </object></typevalue> + </constant><doc> + <text> + <p>This contains the local timezone, found from + various parts of the system, if possible.</p> + </text> +  + </doc> + </docgroup> + <docgroup homogen-name='localtime' homogen-type='constant'> + <constant name='localtime'><typevalue> +  <object>Ruleset.Timezone </object></typevalue> + </constant><doc> + <text> + <p>This is a special timezone, that uses <ref resolved='predef::Calendar.Timezone.localtime'>localtime</ref>() + and <ref>tzname</ref> + to find out what current offset and timezone string to use.</p> +  + <p><ref resolved='predef::Calendar.Timezone.locale'>locale</ref> uses this if there is no other + way of finding a better timezone to use.</p> +  + <p>This timezone is limited by <ref resolved='predef::Calendar.Timezone.localtime'>localtime</ref> and + libc to the range of <tt>time_t</tt>, + which is a MAXINT on most systems - 13 Dec 1901 20:45:52 + to 19 Jan 2038 3:14:07, UTC.</p> + </text> +  + </doc> + </docgroup> + </module> + <module name='YMD'> + <doc> + <text> + <p> + base for all Roman-kind of Calendars, + ie, one with years, months, weeks and days + </p> + </text> +  + </doc> + <docgroup homogen-name='datetime' homogen-type='method'> + <method name='datetime'> +  <returntype><mixed/></returntype> +  <arguments><argument name='unix_time'><type> +  <or><int/><void/></or></type></argument> +  +  </arguments> + </method><doc> + <text> + <p>Replacement for localtime; gives back a mapping: + <pre> +  ([ "year": int // year number (2000 AD=2000, 1 BC==0) +  "month": int(1..) // month of year +  "day": int(1..) // day of month +  "yearday": int(1..) // day of year +  "week": int(1..) // week of year +  "week_day": int(1..) // day of week (depending on calendar) +  "unix": int // unix time +  "julian": float // julian day +  "hour": int(0..) // hour of day, including dst +  "minute": int(0..59) // minute of hour +  "second": int(0..59) // second of minute +  "fraction": float // fraction of second +  "timezone": int // offset to utc, including dst +  ]); + </pre> + This is the same as calling <ref>Second</ref>()-&gt;<ref to='second.datetime'>datetime</ref>(). + </p> + </text> +  + </doc> + </docgroup> + <docgroup homogen-type='method'> + <method name='datetime_name'> +  <returntype><mixed/></returntype> +  <arguments><argument name='unix_time'><type> +  <or><int/><void/></or></type></argument> +  +  </arguments> + </method><method name='datetime_short_name'> +  <returntype><mixed/></returntype> +  <arguments><argument name='unix_time'><type> +  <or><int/><void/></or></type></argument> +  +  </arguments> + </method><doc> + <text> + <p>Compat functions; same as <ref resolved='predef::Calendar.YMD.format_iso'>format_iso</ref> + and <ref resolved='predef::Calendar.YMD.format_iso_short'>format_iso_short</ref>. + </p> + </text> +  + </doc> + </docgroup> + <docgroup homogen-name='dwim_day' homogen-type='method'> + <method name='dwim_day'> +  <returntype> +  <object>Day </object></returntype> +  <arguments><argument name='date'><type><string/></type></argument> +  +  </arguments> + </method><doc> + <text> + <p>Tries a number of different formats on the given date (in order): + <pre> + &lt;ref&gt;parse&lt;/ref&gt; format as in + "%y-%M-%D (%M) -W%W-%e (%e)" "2000-03-20 (Mar) -W12-1 (Mon)" + "%D%*[ /]%M%*[ /-,]%y" "20/3/2000" "20 mar 2000" "20/3 -00" + "%e%*[ ]%D%*[ /]%M%*[ /-,]%y" "Mon 20 Mar 2000" "Mon 20/3 2000" + "%y-%M-%D" "2000-03-20", "00-03-20" + "%d" "20000320", "000320" + "-%y%*[ /]%D%*[ /]%M" "-00 20/3" "-00 20 mar" + "-%y%*[ /]%M%*[ /]%D" "-00 3/20" "-00 march 20" + "%y%*[ /]%D%*[ /]%M" "00 20 mar" "2000 20/3" + "%y%*[ /]%M%*[ /]%D" "2000 march 20" + "%D%*[ -/]%M" "20/3" "20 mar" "20-03" + "%M%*[ -/]%D" "3/20" "march 20" + "%e%*[ -/wv]%W%*[ -/]%y" "mon w12 -00" "1 w12 2000" + "%e%*[ -/wv]%W" "mon w12" + "%e" "monday" "1" + "today" "today" + "last %e" "last monday" + "next %e" "next monday" + </pre> + </p> + </text> + <group><note/><text> + <p>Casts exception if it fails to dwim out a day. + "dwim" means do-what-i-mean. + </p> + </text></group> +  + </doc> + </docgroup> + <docgroup homogen-type='method'> + <method name='format_iso'> +  <returntype> +  <object>string </object></returntype> +  <arguments><argument name='unix_time'><type> +  <or><void/><int/></or></type></argument> +  +  </arguments> + </method><method name='format_iso_short'> +  <returntype> +  <object>string </object></returntype> +  <arguments><argument name='unix_time'><type> +  <or><void/><int/></or></type></argument> +  +  </arguments> + </method><method name='format_iso_tod'> +  <returntype> +  <object>string </object></returntype> +  <arguments><argument name='unix_time'><type> +  <or><void/><int/></or></type></argument> +  +  </arguments> + </method><method name='format_day_iso'> +  <returntype> +  <object>string </object></returntype> +  <arguments><argument name='unix_time'><type> +  <or><void/><int/></or></type></argument> +  +  </arguments> + </method><method name='format_day_iso_short'> +  <returntype> +  <object>string </object></returntype> +  <arguments><argument name='unix_time'><type> +  <or><void/><int/></or></type></argument> +  +  </arguments> + </method><doc> + <text> + <p>Format the object into nice strings; + <pre> + iso "2000-06-02 (Jun) -W22-5 (Fri) 11:57:18 CEST" + iso_short "2000-06-02 11:57:18" + iso_tod "11:57:18" + </pre></p> + </text> +  + </doc> + </docgroup> + <docgroup homogen-type='method'> + <method name='format_iso_ymd'> +  <returntype> +  <object>string </object></returntype> +  <arguments> +  </arguments> + </method><method name='format_ymd'> +  <returntype> +  <object>string </object></returntype> +  <arguments> +  </arguments> + </method><method name='format_ymd_short'> +  <returntype> +  <object>string </object></returntype> +  <arguments> +  </arguments> + </method><method name='format_ymd_xshort'> +  <returntype> +  <object>string </object></returntype> +  <arguments> +  </arguments> + </method><method name='format_iso_week'> +  <returntype> +  <object>string </object></returntype> +  <arguments> +  </arguments> + </method><method name='format_iso_week_short'> +  <returntype> +  <object>string </object></returntype> +  <arguments> +  </arguments> + </method><method name='format_week'> +  <returntype> +  <object>string </object></returntype> +  <arguments> +  </arguments> + </method><method name='format_week_short'> +  <returntype> +  <object>string </object></returntype> +  <arguments> +  </arguments> + </method><method name='format_month'> +  <returntype> +  <object>string </object></returntype> +  <arguments> +  </arguments> + </method><method name='format_month_short'> +  <returntype> +  <object>string </object></returntype> +  <arguments> +  </arguments> + </method><method name='format_iso_time'> +  <returntype> +  <object>string </object></returntype> +  <arguments> +  </arguments> + </method><method name='format_time'> +  <returntype> +  <object>string </object></returntype> +  <arguments> +  </arguments> + </method><method name='format_time_short'> +  <returntype> +  <object>string </object></returntype> +  <arguments> +  </arguments> + </method><method name='format_time_xshort'> +  <returntype> +  <object>string </object></returntype> +  <arguments> +  </arguments> + </method><method name='format_mtime'> +  <returntype> +  <object>string </object></returntype> +  <arguments> +  </arguments> + </method><method name='format_xtime'> +  <returntype> +  <object>string </object></returntype> +  <arguments> +  </arguments> + </method><method name='format_tod'> +  <returntype> +  <object>string </object></returntype> +  <arguments> +  </arguments> + </method><method name='format_todz'> +  <returntype> +  <object>string </object></returntype> +  <arguments> +  </arguments> + </method><method name='format_xtod'> +  <returntype> +  <object>string </object></returntype> +  <arguments> +  </arguments> + </method><method name='format_mod'> +  <returntype> +  <object>string </object></returntype> +  <arguments> +  </arguments> + </method><doc> + <text> + <p>Format the object into nice strings; + <pre> + iso_ymd "2000-06-02 (Jun) -W22-5 (Fri)" [2] + ext_ymd "Friday, 2 June 2000" [2] + ymd "2000-06-02" + ymd_short "20000602" + ymd_xshort "000602" [1] + iso_week "2000-W22" + iso_week_short "2000W22" + week "2000-w22" [2] + week_short "2000w22" [2] + month "2000-06" + month_short "200006" [1] + iso_time "2000-06-02 (Jun) -W22-5 (Fri) 00:00:00 UTC+1" [2] + ext_time "Friday, 2 June 2000, 00:00:00" [2] + ctime "Fri Jun 2 00:00:00 2000\n" [2] [3] + http "Fri, 02 Jun 2000 00:00:00 GMT" [4] + time "2000-06-02 00:00:00" + time_short "20000602 00:00:00" + time_xshort "000602 00:00:00" + mtime "2000-06-02 00:00" + xtime "2000-06-02 00:00:00.000000" + tod "00:00:00" + tod_short "000000" + todz "00:00:00 CET" + todz_iso "00:00:00 UTC+1" + xtod "00:00:00.000000" + mod "00:00" + </pre> + <tt>[1]</tt> note conflict (think 1 February 2003) + <br/><tt>[2]</tt> language dependent + <br/><tt>[3]</tt> as from the libc function ctime() + <br/><tt>[4]</tt> as specified by the HTTP standard; + not language dependent.</p> + </text> +  + </doc> + </docgroup> + <class name='Hour'> + <doc> + <text> + <p>global convinience functions</p> + </text> +  + </doc> + <docgroup homogen-name='Hour' homogen-type='inherit'> + <inherit name='Hour'><classname resolved='predef::Calendar.Time.Hour'>Time.Hour</classname></inherit> + </docgroup> + <docgroup homogen-name='YMD' homogen-type='inherit'> + <inherit name='YMD'><classname resolved='predef::Calendar.YMD.YMD'>YMD</classname></inherit> + </docgroup> + <docgroup homogen-name='parse' homogen-type='method'> + <method name='parse'> +  <returntype> +  <object resolved='predef::Calendar.TimeRange'>TimeRange </object></returntype> +  <arguments><argument name='fmt'><type><string/></type></argument> + <argument name='arg'><type><string/></type></argument> +  +  </arguments> + </method><doc> + <text> + <p>parse a date, create relevant object + fmt is in the format "abc%xdef..." + where abc and def is matched, and %x is + one of those time units: + <pre> + %Y absolute year + %y dwim year (70-99 is 1970-1999, 0-69 is 2000-2069) + %M month (number, name or short name) (needs %y) + %W week (needs %y) + %D date (needs %y, %m) + %d short date (20000304, 000304) + %a day (needs %y) + %e weekday (needs %y, %w) + %h hour (needs %d, %D or %W) + %m minute (needs %h) + %s second (needs %m) + %f fraction of a second (needs %s) + %t short time (205314, 2053) + </pre> + </p> + </text> + <group><note/><text> + <p>Returns 0 if format doesn't match data.</p> + </text></group> +  + </doc> + </docgroup> + </class> + <class name='Week'> + <doc> + <text> + <p>The Calendar week represents a standard time period of + a week. In the Gregorian calendar, the standard week + starts on a sunday and ends on a saturday; in the ISO + calendar, it starts on a monday and ends on a sunday.</p> +  + <p>The week are might not be aligned to the year, and thus + the week may cross year borders and the year of + the week might not be the same as the year of all the + days in the week. The basic rule is that the week year + is the year that has the most days in the week, but + since week number only is specified in the ISO calendar + - and derivates - the week number of most calendars + is the week number of most of the days in the ISO + calendar, which modifies this rule for the Gregorian calendar; + the week number and year is the same as for the ISO calendar, + except for the sundays.</p> +  + <p>When adding, moving and subtracting months + to a week, it falls back to using days.</p> +  + <p>When adding, moving or subtracting years, + if tries to place the moved week in the + resulting year. + </p> + </text> +  + </doc> + <docgroup homogen-name='create' homogen-type='method'> + <method name='create'> +  <returntype> +  <object>void </object></returntype> +  <arguments><argument><value>"unix"</value></argument><argument name='unix_time'><type><int/></type></argument> +  +  </arguments> + </method><method name='create'> +  <returntype> +  <object>void </object></returntype> +  <arguments><argument><value>"julian"</value></argument><argument name='julian_day'><type> +  <or><int/><float/></or></type></argument> +  +  </arguments> + </method><method name='create'> +  <returntype> +  <object>void </object></returntype> +  <arguments><argument name='year'><type><int/></type></argument> + <argument name='week'><type><int/></type></argument> +  +  </arguments> + </method><doc> + <text> + <p>It's possible to create the standard week + by using three different methods; either the normal + way - from standard unix time or the julian day, + and also, for more practical use, from year and week + number. + </p> + </text> +  + </doc> + </docgroup> + <docgroup homogen-name='create' homogen-type='method'> + <method name='create'> +  <returntype> +  <object>void </object></returntype> +  <arguments><argument><value>"unix"</value></argument><argument name='unix_time'><type><int/></type></argument> +  +  </arguments> + </method><method name='create'> +  <returntype> +  <object>void </object></returntype> +  <arguments><argument><value>"julian"</value></argument><argument name='julian_day'><type> +  <or><int/><float/></or></type></argument> +  +  </arguments> + </method><method name='create'> +  <returntype> +  <object>void </object></returntype> +  <arguments><argument name='year'><type><int/></type></argument> + <argument name='month'><type><int/></type></argument> + <argument name='day'><type><int/></type></argument> +  +  </arguments> + </method><method name='create'> +  <returntype> +  <object>void </object></returntype> +  <arguments><argument name='year'><type><int/></type></argument> + <argument name='year_day'><type><int/></type></argument> +  +  </arguments> + </method><method name='create'> +  <returntype> +  <object>void </object></returntype> +  <arguments><argument name='julian_day'><type><int/></type></argument> +  +  </arguments> + </method><doc> + <text> + <p>It's possible to create the day + by using five different methods; either the normal + way - from standard unix time or the julian day, + and also, for more practical use, from year, month and day, + from year and day of year, and from julian day + without extra fuzz.</p> + </text> +  + </doc> + </docgroup> + <docgroup homogen-name='day' homogen-type='method'> + <method name='day'> +  <returntype> +  <object>Day </object></returntype> +  <arguments> +  </arguments> + </method><method name='day'> +  <returntype> +  <object>Day </object></returntype> +  <arguments><argument name='n'><type><int/></type></argument> +  +  </arguments> + </method><method name='day'> +  <returntype> +  <object>Day </object></returntype> +  <arguments><argument name='name'><type><string/></type></argument> +  +  </arguments> + </method><doc> + <text> + <p>The Week type overloads the day() method, + so it is possible to get a specified weekday + by string:</p> +  + <p><tt>week-&gt;day("sunday")</tt></p> +  + <p>The integer and no argument behavior is inherited + from <ref to='ymd.day'>YMD</ref>(). + </p> + </text> + <group><note/><text> + <p>the weekday-from-string routine is language dependent. + </p> + </text></group> +  + </doc> + </docgroup> + </class> + <class name='YMD'> + <doc> + <text> + <p>Base (virtual) time period of the Roman-kind of calendar.</p> + </text> +  + </doc> + <docgroup homogen-type='method'> + <method name='fraction_no'> +  <returntype> +  <object>float </object></returntype> +  <arguments> +  </arguments> + </method><method name='hour_no'> +  <returntype> +  <object>int </object></returntype> +  <arguments> +  </arguments> + </method><method name='julian_day'> +  <returntype> +  <object>int </object></returntype> +  <arguments> +  </arguments> + </method><method name='leap_year'> +  <returntype> +  <object>int </object></returntype> +  <arguments> +  </arguments> + </method><method name='minute_no'> +  <returntype> +  <object>int </object></returntype> +  <arguments> +  </arguments> + </method><method name='month_day'> +  <returntype> +  <object>int </object></returntype> +  <arguments> +  </arguments> + </method><method name='month_no'> +  <returntype> +  <object>int </object></returntype> +  <arguments> +  </arguments> + </method><method name='second_no'> +  <returntype> +  <object>int </object></returntype> +  <arguments> +  </arguments> + </method><method name='unix_time'> +  <returntype> +  <object>int </object></returntype> +  <arguments> +  </arguments> + </method><method name='utc_offset'> +  <returntype> +  <object>int </object></returntype> +  <arguments> +  </arguments> + </method><method name='week_day'> +  <returntype> +  <object>int </object></returntype> +  <arguments> +  </arguments> + </method><method name='week_no'> +  <returntype> +  <object>int </object></returntype> +  <arguments> +  </arguments> + </method><method name='year_day'> +  <returntype> +  <object>int </object></returntype> +  <arguments> +  </arguments> + </method><method name='year_no'> +  <returntype> +  <object>int </object></returntype> +  <arguments> +  </arguments> + </method><method name='month_name'> +  <returntype> +  <object>string </object></returntype> +  <arguments> +  </arguments> + </method><method name='month_shortname'> +  <returntype> +  <object>string </object></returntype> +  <arguments> +  </arguments> + </method><method name='month_day_name'> +  <returntype> +  <object>string </object></returntype> +  <arguments> +  </arguments> + </method><method name='week_day_name'> +  <returntype> +  <object>string </object></returntype> +  <arguments> +  </arguments> + </method><method name='week_day_shortname'> +  <returntype> +  <object>string </object></returntype> +  <arguments> +  </arguments> + </method><method name='week_name'> +  <returntype> +  <object>string </object></returntype> +  <arguments> +  </arguments> + </method><method name='year_name'> +  <returntype> +  <object>string </object></returntype> +  <arguments> +  </arguments> + </method><method name='tzname'> +  <returntype> +  <object>string </object></returntype> +  <arguments> +  </arguments> + </method><method name='tzname_iso'> +  <returntype> +  <object>string </object></returntype> +  <arguments> +  </arguments> + </method><method name='datetime'> +  <returntype> +  <object>method </object></returntype> +  <arguments> +  </arguments> + </method><doc> + <text> + <p>This gives back a mapping with the relevant + time information (representing the start of the period); + <pre> +  ([ "year": int // year number (2000 AD=2000, 1 BC==0) +  "month": int(1..) // month of year +  "day": int(1..) // day of month +  "yearday": int(0..) // day of year +  "week": int(1..) // week of year +  "week_day": int(0..) // day of week +  "timezone": int // offset to utc, including dst +  +  "unix": int // unix time +  "julian": int // julian day +  // for compatibility: +  "hour": 0 // hour of day, including dst +  "minute": 0 // minute of hour +  "second": 0 // second of minute +  "fraction": 0.0 // fraction of second +  ]); + </pre> + </p> + </text> + <group><note/><text> + <p>Day of week is compatible with old versions, + ie, 0 is sunday, 6 is saturday, so it shouldn't be + used to calculate the day of the week with the given + week number. Year day is also backwards compatible, + ie, one (1) less then from the year_day() function.</p> + </text></group> +  + </doc> + </docgroup> + <docgroup homogen-name='TimeRange' homogen-type='inherit'> + <inherit name='TimeRange'><classname resolved='predef::Calendar.TimeRange'>TimeRange</classname></inherit> + </docgroup> + </class> + <class name='Year'> + <doc> + <text> + <p>This is the time period of a year. + </p> + </text> +  + </doc> + <docgroup homogen-name='create' homogen-type='method'> + <method name='create'> +  <returntype> +  <object>void </object></returntype> +  <arguments><argument><value>"unix"</value></argument><argument name='unix_time'><type><int/></type></argument> +  +  </arguments> + </method><method name='create'> +  <returntype> +  <object>void </object></returntype> +  <arguments><argument><value>"julian"</value></argument><argument name='julian_day'><type> +  <or><int/><float/></or></type></argument> +  +  </arguments> + </method><method name='create'> +  <returntype> +  <object>void </object></returntype> +  <arguments><argument name='year'><type><int/></type></argument> +  +  </arguments> + </method><method name='create'> +  <returntype> +  <object>void </object></returntype> +  <arguments><argument name='year'><type><string/></type></argument> +  +  </arguments> + </method><doc> + <text> + <p>It's possible to create the standard week + by using three different methods; either the normal + way - from standard unix time or the julian day, + and also, for more practical use, from the year number. + </p> + </text> +  + </doc> + </docgroup> + <docgroup homogen-name='TimeRange' homogen-type='inherit'> + <inherit name='TimeRange'><classname resolved='predef::Calendar.TimeRange'>TimeRange</classname></inherit> + </docgroup> + <docgroup homogen-name='YMD' homogen-type='inherit'> + <inherit name='YMD'><classname resolved='predef::Calendar.YMD.YMD'>YMD</classname></inherit> + </docgroup> + <docgroup homogen-name='month' homogen-type='method'> + <method name='month'> +  <returntype> +  <object>Month </object></returntype> +  <arguments> +  </arguments> + </method><method name='month'> +  <returntype> +  <object>Month </object></returntype> +  <arguments><argument name='n'><type><int/></type></argument> +  +  </arguments> + </method><method name='month'> +  <returntype> +  <object>Month </object></returntype> +  <arguments><argument name='name'><type><string/></type></argument> +  +  </arguments> + </method><doc> + <text> + <p>The Year type overloads the month() method, + so it is possible to get a specified month + by string:</p> +  + <p><tt>year-&gt;month("April")</tt></p> +  + <p>The integer and no argument behavior is inherited + from <ref to='ymd.month'>YMD</ref>().</p> + </text> +  + </doc> + </docgroup> + <docgroup homogen-name='week' homogen-type='method'> + <method name='week'> +  <returntype> +  <object resolved='predef::Calendar.YMD.Week'>Week </object></returntype> +  <arguments> +  </arguments> + </method><method name='week'> +  <returntype> +  <object resolved='predef::Calendar.YMD.Week'>Week </object></returntype> +  <arguments><argument name='n'><type><int/></type></argument> +  +  </arguments> + </method><method name='week'> +  <returntype> +  <object resolved='predef::Calendar.YMD.Week'>Week </object></returntype> +  <arguments><argument name='name'><type><string/></type></argument> +  +  </arguments> + </method><doc> + <text> + <p>The Year type overloads the week() method, + so it is possible to get a specified week + by name:</p> +  + <p><tt>year-&gt;week("17")</tt> + <tt>year-&gt;week("w17")</tt></p> +  + <p>The integer and no argument behavior is inherited + from <ref to='ymd.week'>YMD</ref>().</p> +  + <p>This is useful, since the first week of a year + not always (about half the years, in the ISO calendar) + is numbered '1'. + </p> + </text> +  + </doc> + </docgroup> + </class> + </module> + </module> + <module name='Calendar_I'> + <doc> + <text> + <p>   This module implements calendar calculations, and base classes   for time units.   </p>
1332:   <doc>   <text>   <p>time units: - <ref resolved='predef::Calendar.Gregorian.Year'>Year</ref>, <ref>Month</ref>, <ref>Week</ref>, <ref>Day</ref> + <ref resolved='predef::Calendar_I.Gregorian.Year'>Year</ref>, <ref>Month</ref>, <ref>Week</ref>, <ref>Day</ref>   </p>   </text>   
1386:   <class name='Year'>   <doc>   <text> - <p>A <ref resolved='predef::Calendar.time_unit'>Calendar.time_unit</ref>.</p> + <p>A <ref>Calendar.time_unit</ref>.</p>      <p>Lesser units: <ref>Month</ref>, <ref>Week</ref>, <ref>Day</ref>   Greater units: none</p>
1470:   </method><method name='`-'>    <returntype>    <object>object </object></returntype> -  <arguments><argument name='x'><type><object resolved='predef::Calendar.time_unit.next'/></type></argument> +  <arguments><argument name='x'><type><object resolved='predef::Calendar_I.time_unit.next'/></type></argument>       </arguments>   </method><doc>