|
|
| version 1.48, 2003/10/30 13:16:53 | version 1.49, 2003/11/03 11:06:18 |
|---|---|
| Line 378 static void _calendar(Request& r, Method | Line 378 static void _calendar(Request& r, Method |
| r.write_no_lang(*new VTable(table)); | r.write_no_lang(*new VTable(table)); |
| } | } |
| static void _unix_timestamp(Request& r, MethodParams& params) { | |
| VDate& vdate=GET_SELF(r, VDate); | |
| if(params.count()==0) { | |
| // ^date.unix-timestamp[] | |
| r.write_no_lang(*new VInt((int)vdate.get_time())); | |
| } else { | |
| // ^unix-timestamp(time_t) | |
| time_t t=(time_t)params.as_int(0, "Unix timestamp must be integer", r); | |
| vdate.set_time(t); | |
| } | |
| } | |
| // constructor | // constructor |
| MDate::MDate(): Methoded("date") { | MDate::MDate(): Methoded("date") { |
| Line 399 MDate::MDate(): Methoded("date") { | Line 414 MDate::MDate(): Methoded("date") { |
| // ^date:calendar[week|weekeng;year;month;day] = table | // ^date:calendar[week|weekeng;year;month;day] = table |
| add_native_method("calendar", Method::CT_STATIC, _calendar, 3, 4); | add_native_method("calendar", Method::CT_STATIC, _calendar, 3, 4); |
| // ^unix-timestamp[] | |
| add_native_method("unix-timestamp", Method::CT_DYNAMIC, _unix_timestamp, 0, 1); | |
| } | } |