Index: src/i18n.cc |
diff --git a/src/i18n.cc b/src/i18n.cc |
index 7899f2937d5430760cae3ef60cd81e24d94452a8..4f5431fa95fd9904dc4f858cdc9e66f62a74638c 100644 |
--- a/src/i18n.cc |
+++ b/src/i18n.cc |
@@ -16,6 +16,7 @@ |
#include "unicode/decimfmt.h" |
#include "unicode/dtfmtsym.h" |
#include "unicode/dtptngen.h" |
+#include "unicode/gregocal.h" |
#include "unicode/locid.h" |
#include "unicode/numfmt.h" |
#include "unicode/numsys.h" |
@@ -96,6 +97,16 @@ icu::SimpleDateFormat* CreateICUDateFormat( |
icu::Calendar* calendar = |
icu::Calendar::createInstance(tz, icu_locale, status); |
+ if (calendar->getDynamicClassID() == |
+ icu::GregorianCalendar::getStaticClassID()) { |
+ icu::GregorianCalendar* gc = (icu::GregorianCalendar*)calendar; |
+ UErrorCode status = U_ZERO_ERROR; |
+ // The beginning of ECMAScript time, namely -(2**53) |
+ const double start_of_time = -9007199254740992; |
+ gc->setGregorianChange(start_of_time, status); |
+ DCHECK(U_SUCCESS(status)); |
+ } |
+ |
// Make formatter from skeleton. Calendar and numbering system are added |
// to the locale as Unicode extension (if they were specified at all). |
icu::SimpleDateFormat* date_format = NULL; |