pike.git
/
lib
/
modules
/
Calendar.pmod
/
YMD.pike
version
»
Context lines:
10
20
40
80
file
none
3
pike.git/lib/modules/Calendar.pmod/YMD.pike:1:
//! //! module Calendar //! submodule YMD //! //! base for all Roman-kind of Calendars, //! ie, one with years, months, weeks and days //!
+
//! inherits Time
#pike __REAL_VERSION__ // #pragma strict_types inherit Calendar.Time:Time; #include "constants.h" // ----------------
pike.git/lib/modules/Calendar.pmod/YMD.pike:1432:
} cYear set_ruleset(Calendar.Ruleset r) { return Year("ymd_y",r,y,yjd,n); } } // ----------------------------------------------------------------
-
//
Month
+
//
!
class
Month
+
//!
inherits YMD
// ---------------------------------------------------------------- function(mixed...:cMonth) Month=cMonth; class cMonth { inherit YMD; constant is_month=1; int nd; // number of days
pike.git/lib/modules/Calendar.pmod/YMD.pike:1723:
//! 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. //! //! When adding, moving and subtracting months //! to a week, it falls back to using days. //! //! When adding, moving or subtracting years, //! if tries to place the moved week in the //! resulting year.
+
//!
+
//! inherits YMD
// ---------------------------------------------------------------- function(mixed...:cWeek) Week=cWeek; class cWeek { inherit YMD; // Note: wy, w and wd are never CALUNKNOWN in this class. constant is_week=1;
pike.git/lib/modules/Calendar.pmod/YMD.pike:2061:
{ return Week("ymd_yjwm",r,y,yjd,jd,wy,w,n,md,m,mnd); } // --- needs to be defined protected int weeks_to_week(int y,int m); } // ----------------------------------------------------------------
-
//
Day
+
//
!
class
Day
+
//!
inherits YMD
// ---------------------------------------------------------------- class cDay { inherit YMD; constant is_day=1; int nw; //!
pike.git/lib/modules/Calendar.pmod/YMD.pike:2511:
//! inherits YMD //------------------------------------------------------------------------ class cHour { inherit Time::cHour; inherit YMD_Time; OVERLOAD_TIMEOFDAY; }
+
//------------------------------------------------------------------------
+
//! class Minute
+
//! inherits Time.Minute
+
//! inherits YMD
+
//------------------------------------------------------------------------
+
class cMinute { inherit Time::cMinute; inherit YMD_Time; OVERLOAD_TIMEOFDAY; }
-
+
//------------------------------------------------------------------------
+
//! class Second
+
//! inherits Time.Second
+
//! inherits YMD
+
//------------------------------------------------------------------------
+
class cSecond { inherit Time::cSecond; inherit YMD_Time; OVERLOAD_TIMEOFDAY; }
-
+
//------------------------------------------------------------------------
+
//! class Fraction
+
//! inherits Time.Fraction
+
//! inherits YMD
+
//------------------------------------------------------------------------
+
class cFraction { inherit Time::cFraction; inherit YMD_Time; OVERLOAD_TIMEOFDAY; }
-
+
//------------------------------------------------------------------------
+
//! class SuperTimeRange
+
//! inherits Time.SuperTimeRange
+
//------------------------------------------------------------------------
+
class cSuperTimeRange { inherit Time::cSuperTimeRange; array(cYear) years(int ...range) { return get_units("years",@range); } cYear year(void|int n) { return get_unit("years",n); } int number_of_years() { return num_units("years"); } array(cMonth) months(int ...range) { return get_units("months",@range); } cMonth month(void|int n) { return get_unit("months",n); }