derick Wed Feb 13 21:53:01 2008 UTC
Modified files:
/php-src/ext/date php_date.c
Log:
- Add some missing elements from the return value.
http://cvs.php.net/viewvc.cgi/php-src/ext/date/php_date.c?r1=1.164&r2=1.165&diff_format=u
Index: php-src/ext/date/php_date.c
diff -u php-src/ext/date/php_date.c:1.164 php-src/ext/date/php_date.c:1.165
--- php-src/ext/date/php_date.c:1.164 Sat Feb 2 17:25:40 2008
+++ php-src/ext/date/php_date.c Wed Feb 13 21:53:01 2008
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_date.c,v 1.164 2008/02/02 17:25:40 derick Exp $ */
+/* $Id: php_date.c,v 1.165 2008/02/13 21:53:01 derick Exp $ */
#include "php.h"
#include "php_streams.h"
@@ -2098,7 +2098,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);
}
@@ -2113,7 +2113,13 @@
if (parsed_time->have_weekday_relative) {
add_ascii_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_ascii_assoc_long(element, "weekdays",
parsed_time->special.amount);
+ }
+ if (parsed_time->relative.first_last_day_of) {
+ add_ascii_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_ascii_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