summaryrefslogtreecommitdiffstats
path: root/intl/icu-patches/bug-1838173-ICU-22412-start-time-iso8601.diff
diff options
context:
space:
mode:
Diffstat (limited to 'intl/icu-patches/bug-1838173-ICU-22412-start-time-iso8601.diff')
-rw-r--r--intl/icu-patches/bug-1838173-ICU-22412-start-time-iso8601.diff47
1 files changed, 47 insertions, 0 deletions
diff --git a/intl/icu-patches/bug-1838173-ICU-22412-start-time-iso8601.diff b/intl/icu-patches/bug-1838173-ICU-22412-start-time-iso8601.diff
new file mode 100644
index 0000000000..3338a72457
--- /dev/null
+++ b/intl/icu-patches/bug-1838173-ICU-22412-start-time-iso8601.diff
@@ -0,0 +1,47 @@
+# Allow to set the Gregorian change date for ISO8601 calendars.
+#
+# ICU bug: https://unicode-org.atlassian.net/browse/ICU-22412
+
+diff --git a/intl/icu/source/i18n/ucal.cpp b/intl/icu/source/i18n/ucal.cpp
+--- a/intl/icu/source/i18n/ucal.cpp
++++ b/intl/icu/source/i18n/ucal.cpp
+@@ -22,10 +22,11 @@
+ #include "unicode/ustring.h"
+ #include "unicode/strenum.h"
+ #include "unicode/localpointer.h"
+ #include "cmemory.h"
+ #include "cstring.h"
++#include "iso8601cal.h"
+ #include "ustrenum.h"
+ #include "uenumimp.h"
+ #include "ulist.h"
+ #include "ulocimp.h"
+
+@@ -305,11 +306,12 @@ ucal_setGregorianChange(UCalendar *cal,
+ // We normally don't check "this" pointers for nullptr, but this here avoids
+ // compiler-generated exception-throwing code in case cal == nullptr.
+ *pErrorCode = U_ILLEGAL_ARGUMENT_ERROR;
+ return;
+ }
+- if(typeid(*cpp_cal) != typeid(GregorianCalendar)) {
++ if(typeid(*cpp_cal) != typeid(GregorianCalendar) &&
++ typeid(*cpp_cal) != typeid(ISO8601Calendar)) {
+ *pErrorCode = U_UNSUPPORTED_ERROR;
+ return;
+ }
+ gregocal->setGregorianChange(date, *pErrorCode);
+ }
+@@ -327,11 +329,12 @@ ucal_getGregorianChange(const UCalendar
+ // We normally don't check "this" pointers for nullptr, but this here avoids
+ // compiler-generated exception-throwing code in case cal == nullptr.
+ *pErrorCode = U_ILLEGAL_ARGUMENT_ERROR;
+ return (UDate)0;
+ }
+- if(typeid(*cpp_cal) != typeid(GregorianCalendar)) {
++ if(typeid(*cpp_cal) != typeid(GregorianCalendar) &&
++ typeid(*cpp_cal) != typeid(ISO8601Calendar)) {
+ *pErrorCode = U_UNSUPPORTED_ERROR;
+ return (UDate)0;
+ }
+ return gregocal->getGregorianChange();
+ }