@@ -408,6 +408,58 @@ U_CFUNC PHP_FUNCTION(intlcal_set)
408408 RETURN_TRUE;
409409}
410410
411+ U_CFUNC PHP_METHOD (IntlCalendar, setDate)
412+ {
413+ zend_long year, month, day;
414+
415+ CALENDAR_METHOD_INIT_VARS;
416+
417+ object = getThis ();
418+
419+ if (zend_parse_method_parameters (ZEND_NUM_ARGS (), object, " Olll" ,
420+ &object, Calendar_ce_ptr, &year, &month, &day) == FAILURE) {
421+ RETURN_THROWS ();
422+ }
423+
424+ ZEND_VALUE_ERROR_OUT_OF_BOUND_VALUE (year, 1 );
425+ ZEND_VALUE_ERROR_OUT_OF_BOUND_VALUE (month, 2 );
426+ ZEND_VALUE_ERROR_OUT_OF_BOUND_VALUE (day, 3 );
427+
428+ CALENDAR_METHOD_FETCH_OBJECT;
429+
430+ co->ucal ->set ((int32_t ) year, (int32_t ) month, (int32_t ) day);
431+ }
432+
433+ U_CFUNC PHP_METHOD (IntlCalendar, setDateTime)
434+ {
435+ zend_long year, month, day, hour, minute, second = 0 ;
436+ bool second_is_null = true ;
437+
438+ CALENDAR_METHOD_INIT_VARS;
439+
440+ object = getThis ();
441+
442+ if (zend_parse_method_parameters (ZEND_NUM_ARGS (), object, " Olllll|l!" ,
443+ &object, Calendar_ce_ptr, &year, &month, &day, &hour, &minute, &second, &second_is_null) == FAILURE) {
444+ RETURN_THROWS ();
445+ }
446+
447+ ZEND_VALUE_ERROR_OUT_OF_BOUND_VALUE (year, 1 );
448+ ZEND_VALUE_ERROR_OUT_OF_BOUND_VALUE (month, 2 );
449+ ZEND_VALUE_ERROR_OUT_OF_BOUND_VALUE (day, 3 );
450+ ZEND_VALUE_ERROR_OUT_OF_BOUND_VALUE (hour, 4 );
451+ ZEND_VALUE_ERROR_OUT_OF_BOUND_VALUE (minute, 5 );
452+
453+ CALENDAR_METHOD_FETCH_OBJECT;
454+
455+ if (second_is_null) {
456+ co->ucal ->set ((int32_t ) year, (int32_t ) month, (int32_t ) day, (int32_t ) hour, (int32_t ) minute);
457+ } else {
458+ ZEND_VALUE_ERROR_OUT_OF_BOUND_VALUE (second, 6 );
459+ co->ucal ->set ((int32_t ) year, (int32_t ) month, (int32_t ) day, (int32_t ) hour, (int32_t ) minute, (int32_t ) second);
460+ }
461+ }
462+
411463U_CFUNC PHP_FUNCTION (intlcal_roll)
412464{
413465 zval *zvalue;
0 commit comments