--- parser3/src/classes/date.C 2002/02/08 08:30:09 1.16 +++ parser3/src/classes/date.C 2002/03/05 12:20:48 1.18 @@ -4,7 +4,7 @@ Copyright (c) 2001, 2002 ArtLebedev Group (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) - $Id: date.C,v 1.16 2002/02/08 08:30:09 paf Exp $ + $Id: date.C,v 1.18 2002/03/05 12:20:48 paf Exp $ */ #include "classes.h" @@ -37,7 +37,7 @@ static void _now(Request& r, const Strin vdate->set_time(time(0)); } -static void _set(Request& r, const String& method_name, MethodParams *params) { +static void _create(Request& r, const String& method_name, MethodParams *params) { Pool& pool=r.pool(); VDate *vdate=static_cast(r.self); @@ -183,6 +183,10 @@ static Table *fill_week_days(Request& r, const String& method_name, MethodParams *params, bool rus){ Pool& pool=r.pool(); Array& columns=*new(pool) Array(pool, 4); + columns+=new(pool) String(pool, "year"); + columns+=new(pool) String(pool, "month"); + columns+=new(pool) String(pool, "day"); + columns+=new(pool) String(pool, "week_day"); Table *result=new(pool) Table(pool, &method_name, &columns); int year=params->as_int(1, "year must be int", r); @@ -259,7 +263,8 @@ MDate::MDate(Pool& apool) : Methoded(apo add_native_method("now", Method::CT_DYNAMIC, _now, 0, 0); // ^set(float days) - add_native_method("set", Method::CT_DYNAMIC, _set, 1, 6); + add_native_method("create", Method::CT_DYNAMIC, _create, 1, 6); + add_native_method("set", Method::CT_DYNAMIC, _create, 1, 6); // ^sql-string[] add_native_method("sql-string", Method::CT_DYNAMIC, _sql_string, 0, 0);