summaryrefslogtreecommitdiff
path: root/ext/intl/calendar/calendar_methods.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'ext/intl/calendar/calendar_methods.cpp')
-rw-r--r--ext/intl/calendar/calendar_methods.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/ext/intl/calendar/calendar_methods.cpp b/ext/intl/calendar/calendar_methods.cpp
index 2d33bd1952..db10502a18 100644
--- a/ext/intl/calendar/calendar_methods.cpp
+++ b/ext/intl/calendar/calendar_methods.cpp
@@ -997,6 +997,32 @@ U_CFUNC PHP_FUNCTION(intlcal_set_lenient)
RETURN_TRUE;
}
+U_CFUNC PHP_FUNCTION(intlcal_set_minimal_days_in_first_week)
+{
+ long num_days;
+ CALENDAR_METHOD_INIT_VARS;
+
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(),
+ "Ol", &object, Calendar_ce_ptr, &num_days) == FAILURE) {
+ intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
+ "intlcal_set_minimal_days_in_first_week: bad arguments", 0 TSRMLS_CC);
+ RETURN_FALSE;
+ }
+
+ if (num_days < 1 || num_days > 7) {
+ intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
+ "intlcal_set_minimal_days_in_first_week: invalid number of days; "
+ "must be between 1 and 7", 0 TSRMLS_CC);
+ RETURN_FALSE;
+ }
+
+ CALENDAR_METHOD_FETCH_OBJECT;
+
+ co->ucal->setMinimalDaysInFirstWeek((uint8_t)num_days);
+
+ RETURN_TRUE;
+}
+
U_CFUNC PHP_FUNCTION(intlcal_equals)
{
zval *other_object;