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:1181:
} result += ({ start->distance(end) }); return result; } // ---------------------------------------- // virtual functions needed // ---------------------------------------- string nice_print();
-
string _sprintf(int t,mapping m)
+
protected
string _sprintf(int t,mapping m)
{ switch (t) { case 't': return "Calendar."+calendar_name()+".YMD"; default: return ::_sprintf(t,m); } }
pike.git/lib/modules/Calendar.pmod/YMD.pike:1229:
//! method void create("julian",int|float julian_day) //! method void create(int year) //! method void create(string year) //! method void create(TimeRange range) //! It's possible to create the standard year //! 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. //!
-
void create(mixed ...args)
+
protected
void create(mixed ...args)
{ if (!sizeof(args)) { create_now(); return; } else switch (args[0]) { case "ymd_y": rules=args[1];
pike.git/lib/modules/Calendar.pmod/YMD.pike:1311:
return Year("ymd_y",rules,y,yjd,0); } TimeRange end() { return Year("ymd_yn",rules,y+n,0); } // ----------------
-
string _sprintf(int t,mapping m)
+
protected
string _sprintf(int t,mapping m)
{ switch (t) { case 'O': if (n!=1) return sprintf("Year(%s)",nice_print_period()); return sprintf("Year(%s)",nice_print()); case 't': return "Calendar."+calendar_name()+".Year"; default:
pike.git/lib/modules/Calendar.pmod/YMD.pike:1540:
function(mixed...:cMonth) Month=cMonth; class cMonth { inherit YMD; constant is_month=1; int nd; // number of days int nw; // number of weeks
-
void create(mixed ...args)
+
protected
void create(mixed ...args)
{ if (!sizeof(args)) { rules=default_rules; create_unixtime_default(time()); return; } else switch (args[0]) {
pike.git/lib/modules/Calendar.pmod/YMD.pike:1618:
[y,yjd]=year_from_julian_day(jd=_jd); [m,zmd,nd,yd]=month_from_yday(y,1+jd-yjd); jd=yd+yjd-1; n=1; md=1; nw=wd=w=wy=CALUNKNOWN; // unknown } }
-
string _sprintf(int t,mapping m)
+
protected
string _sprintf(int t,mapping m)
{ // return sprintf("month y=%d yjd=%d m=%d jd=%d yd=%d n=%d nd=%d", // y,yjd,m,jd,yd,n,number_of_days()); switch (t) { case 'O': if (n!=1) return sprintf("Month(%s)",nice_print_period()); return sprintf("Month(%s)",nice_print()); case 't':
pike.git/lib/modules/Calendar.pmod/YMD.pike:1842:
//! method void create("unix",int unix_time) //! method void create("julian",int|float julian_day) //! method void create(int year,int week) //! 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. //!
-
void create(mixed ...args)
+
protected
void create(mixed ...args)
{ if (!sizeof(args)) { rules=default_rules; create_unixtime_default(time()); return; } else switch (args[0]) {
pike.git/lib/modules/Calendar.pmod/YMD.pike:1925:
[wy,w,zwd,int nd,jd]=week_from_julian_day(_jd); [y,yjd]=year_from_julian_day(_jd); yd=1+jd-yjd; n=1; wd=1; md=m=CALUNKNOWN; // unknown } }
-
string _sprintf(int t,mapping m)
+
protected
string _sprintf(int t,mapping m)
{ // return sprintf("week y=%d yjd=%d w=%d jd=%d yd=%d n=%d nd=%d", // y,yjd,w,jd,yd,n,number_of_days()); switch (t) { case 'O': if (n!=1) return sprintf("Week(%s)",nice_print_period()); return sprintf("Week(%s)",nice_print()); case 't':
pike.git/lib/modules/Calendar.pmod/YMD.pike:2182:
//! method void create(int year,int month,int day) //! method void create(int year,int year_day) //! method void create(int julian_day) //! 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.
-
void create(mixed ...args)
+
protected
void create(mixed ...args)
{ if (!sizeof(args)) { rules=default_rules; create_unixtime_default(time()); return; } else switch (args[0]) {
pike.git/lib/modules/Calendar.pmod/YMD.pike:2302:
{ create_unixtime_default((int)((jd-2440588)*86400)); } else { [y,yjd]=year_from_julian_day(jd=_jd); yd=1+jd-yjd; } }
-
string _sprintf(int t,mapping m)
+
protected
string _sprintf(int t,mapping m)
{ switch (t) { case 'O': catch { if (n!=1) return sprintf("Day(%s)",nice_print_period()); return sprintf("Day(%s)",nice_print()); }; return sprintf("Day(%d)", unix_time());