Branch: Tag:

2001-05-05

2001-05-05 15:18:49 by Mirar (Pontus Hagland) <pike@sort.mirar.org>

removing "AutoDOC mk II" conversion
YMD.pmod: adding : to day/time separator in dwim

Rev: lib/modules/Calendar.pmod/Calendar.pike:1.5
Rev: lib/modules/Calendar.pmod/Coptic.pmod:1.5
Rev: lib/modules/Calendar.pmod/Discordian.pmod:1.6
Rev: lib/modules/Calendar.pmod/Event.pmod:1.13
Rev: lib/modules/Calendar.pmod/Gregorian.pmod:1.6
Rev: lib/modules/Calendar.pmod/ISO.pmod:1.6
Rev: lib/modules/Calendar.pmod/Islamic.pmod:1.6
Rev: lib/modules/Calendar.pmod/Julian.pmod:1.7
Rev: lib/modules/Calendar.pmod/Language.pmod:1.16
Rev: lib/modules/Calendar.pmod/Roman.pmod:1.5
Rev: lib/modules/Calendar.pmod/Ruleset.pike:1.9
Rev: lib/modules/Calendar.pmod/Stardate.pmod:1.7
Rev: lib/modules/Calendar.pmod/Swedish.pmod:1.6
Rev: lib/modules/Calendar.pmod/TZnames.pmod:1.9
Rev: lib/modules/Calendar.pmod/Time.pmod:1.13
Rev: lib/modules/Calendar.pmod/TimeRanges.pmod:1.17
Rev: lib/modules/Calendar.pmod/Timezone.pmod:1.18
Rev: lib/modules/Calendar.pmod/YMD.pmod:1.31

1: + //! module Calendar + //! submodule Stardate   //! This implements TNG stardates.      #pike __REAL_VERSION__
14:   string calendar_name() { return "Stardate"; }      function(mixed...:cTick) Tick=cTick; -  - //! Stardate clock tick. +    class cTick   {    inherit TimeRange;
25:    float t;    float len;    -  //! @decl void create(mixed ... args) -  //! @decl void create(int|float date) -  //! @decl void create() + //! method void create(mixed ...) + //! method void create(int|float date) + //! method void create()   //! 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.   //! -  //! You can also omit any arguments to @[create()]. + //! You can also omit any arguments to create now.   //! -  //! @bugs + //! known bugs:   //! Since the precision is limited to the float type   //! of pike you can get non-precise results:   //! -  //! @pre{ + //! <pre>   //! > 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> +  +     void create(mixed ...args)    {    switch (sizeof(args))
93:    len=0.0;    }    -  //! This gives back the start of the stardate period, -  //! as a float. + // method float tic() + // This gives back the start of the stardate period, + // as a float. +     float tic()    {    return t;    }    -  + //! method float tics()   //! This gives back the number of stardate tics   //! in the period. -  +     float tics()    {    return len;    }    -  //! @decl int number_of_seconds() -  //! @decl int number_of_days() -  //! These return the Gregorian/Earth/ISO number of seconds + //! method int number_of_seconds() + //! method int number_of_days() + //! This gives back the Gregorian/Earth/ISO number of seconds    //! and number of days, for convinience and conversion to    //! other calendars.   
264:    return sprintf("%.3f",t);    }    -  //! @decl string format_long() -  //! @decl string format_short() -  //! @decl string format_vshort() + //! string format_long() + //! string format_short() + //! string format_vshort()   //! Format the stardate tick nicely. -  //! @pre{ + //! <pre>   //! long "-322537.312"   //! short "77463.312" (w/o >100000-component)   //! short "7463.312" (w/o >10000-component) -  //! @} + //! </pre>       string format_long()    {
300:   // global convinience functions   //------------------------------------------------------------------------    + //! method TimeofDay now()   //! Give the zero-length time period of the   //! current time. -  +    TimeofDay now()   {    return Tick();   }