derick Wed Feb 13 21:53:12 2008 UTC Modified files: (Branch: PHP_5_3) /php-src/ext/date php_date.c Log: - MFH: Add some missing elements from the return value. http://cvs.php.net/viewvc.cgi/php-src/ext/date/php_date.c?r1=1.43.2.45.2.51.2.18&r2=1.43.2.45.2.51.2.19&diff_format=u Index: php-src/ext/date/php_date.c diff -u php-src/ext/date/php_date.c:1.43.2.45.2.51.2.18 php-src/ext/date/php_date.c:1.43.2.45.2.51.2.19 --- php-src/ext/date/php_date.c:1.43.2.45.2.51.2.18 Sat Feb 2 17:25:54 2008 +++ php-src/ext/date/php_date.c Wed Feb 13 21:53:12 2008 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_date.c,v 1.43.2.45.2.51.2.18 2008/02/02 17:25:54 derick Exp $ */ +/* $Id: php_date.c,v 1.43.2.45.2.51.2.19 2008/02/13 21:53:12 derick Exp $ */ #include "php.h" #include "php_streams.h" @@ -1973,7 +1973,7 @@ break; } } - if (parsed_time->have_relative || parsed_time->have_weekday_relative) { + if (parsed_time->have_relative || parsed_time->have_weekday_relative || parsed_time->have_special_relative || parsed_time->relative.first_last_day_of) { MAKE_STD_ZVAL(element); array_init(element); } @@ -1988,7 +1988,13 @@ if (parsed_time->have_weekday_relative) { add_assoc_long(element, "weekday", parsed_time->relative.weekday); } - if (parsed_time->have_relative || parsed_time->have_weekday_relative) { + if (parsed_time->have_special_relative && (parsed_time->special.type == TIMELIB_SPECIAL_WEEKDAY)) { + add_assoc_long(element, "weekdays", parsed_time->special.amount); + } + if (parsed_time->relative.first_last_day_of) { + add_assoc_bool(element, parsed_time->relative.first_last_day_of == 1 ? "first_day_of_month" : "last_day_of_month", 1); + } + if (parsed_time->have_relative || parsed_time->have_weekday_relative || parsed_time->have_special_relative || parsed_time->relative.first_last_day_of) { add_assoc_zval(return_value, "relative", element); } timelib_time_dtor(parsed_time);
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php