Reviewed by .
authorkmccullo <kmccullo@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 15 Mar 2007 03:42:03 +0000 (03:42 +0000)
committerkmccullo <kmccullo@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 15 Mar 2007 03:42:03 +0000 (03:42 +0000)
        - Fixed one more build breakage

        * kjs/date_object.cpp:
        (KJS::formatLocaleDate):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@20205 268f45cc-cd09-0410-ab3c-d52691b4dbfc

JavaScriptCore/ChangeLog
JavaScriptCore/kjs/date_object.cpp

index 257bc19..433e7e3 100644 (file)
@@ -2,6 +2,15 @@
 
         Reviewed by .
 
 
         Reviewed by .
 
+        - Fixed one more build breakage
+
+        * kjs/date_object.cpp:
+        (KJS::formatLocaleDate):
+
+2007-03-14  Kevin McCullough  <kmccullough@apple.com>
+
+        Reviewed by .
+
         - Fixed a build breakage.
 
         * kjs/DateMath.cpp:
         - Fixed a build breakage.
 
         * kjs/DateMath.cpp:
index b33104a..7c0fb78 100644 (file)
@@ -164,7 +164,11 @@ static JSCell* formatLocaleDate(const GregorianDateTime& gdt, const LocaleDateTi
  
     // Offset year if needed
     struct tm localTM = gdt;
  
     // Offset year if needed
     struct tm localTM = gdt;
-    localTM.tm_year = equivalentYearForDST(gdt.year + 1900) - 1900;
+    int year = gdt.year + 1900;
+    bool yearNeedsOffset = year < 1900 || year > 2038;
+    if (yearNeedsOffset) {
+        localTM.tm_year = equivalentYearForDST(year) - 1900;
+     }
  
     // Do the formatting
     const int bufsize=128;
  
     // Do the formatting
     const int bufsize=128;