|
|
| version 1.73, 2005/12/09 07:18:07 | version 1.76, 2007/03/22 13:38:25 |
|---|---|
| Line 131 static void _create(Request& r, MethodPa | Line 131 static void _create(Request& r, MethodPa |
| "invalid datetime"); | "invalid datetime"); |
| vdate.set_time(t); | vdate.set_time(t); |
| } | } |
| } else if(params.count()>=2) { // ^create(y;m;d[;h[;m[;s]]]) | } else { // ^create(y;m;d[;h[;m[;s]]]) |
| assert(params.count()<=6); | |
| tm tmIn; memset(&tmIn, 0, sizeof(tmIn)); | tm tmIn; memset(&tmIn, 0, sizeof(tmIn)); |
| tmIn.tm_isdst=-1; | tmIn.tm_isdst=-1; |
| tmIn.tm_year=to_tm_year(params.as_int(0, "year must be int", r)); | tmIn.tm_year=to_tm_year(params.as_int(0, "year must be int", r)); |
| Line 142 static void _create(Request& r, MethodPa | Line 143 static void _create(Request& r, MethodPa |
| if(params.count()>4) tmIn.tm_min=params.as_int(4, "minutes must be int", r); | if(params.count()>4) tmIn.tm_min=params.as_int(4, "minutes must be int", r); |
| if(params.count()>5) tmIn.tm_sec=params.as_int(5, "seconds must be int", r); | if(params.count()>5) tmIn.tm_sec=params.as_int(5, "seconds must be int", r); |
| vdate.set_time(tmIn); | vdate.set_time(tmIn); |
| } else | }; |
| throw Exception("parser.runtime", | |
| 0, | |
| "invalid params count, must be 1 or >=2"); | |
| } | } |
| static void _sql_string(Request& r, MethodParams&) { | static void _sql_string(Request& r, MethodParams&) { |
| Line 292 static Table& fill_month_days(Request& r | Line 290 static Table& fill_month_days(Request& r |
| const int weekno_buf_size=2+1/*for stupid snprintfs*/ +1; | const int weekno_buf_size=2+1/*for stupid snprintfs*/ +1; |
| weekno_buf=new(PointerFreeGC) char[weekno_buf_size]; | weekno_buf=new(PointerFreeGC) char[weekno_buf_size]; |
| weekno_size=snprintf(weekno_buf, weekno_buf_size, "%02d", VDate::week_no(tms)); | VDate::yw week = VDate::CalcWeek(tms); |
| weekno_size=snprintf(weekno_buf, weekno_buf_size, "%02d", week.week); | |
| } | } |
| } | } |