Bug 483769 - dateFormatYearMonth should generate 4 digits year; r=smontagu
authorAtsushi Sakai <dev-null@hotmail.co.jp>
Sat, 21 Mar 2009 00:38:47 +0100
changeset 26435 38bf155ba088d5a70c9d017d871c4073debede03
parent 26434 10e8371749f9d4e7f1444c313db6744333453c84
child 26436 146ea3a52cf909799d95cb44639e5e8f6cfa0707
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmontagu
bugs483769
milestone1.9.2a1pre
Bug 483769 - dateFormatYearMonth should generate 4 digits year; r=smontagu
intl/locale/src/mac/nsDateTimeFormatMac.cpp
intl/locale/src/os2/nsDateTimeFormatOS2.cpp
intl/locale/src/unix/nsDateTimeFormatUnix.cpp
--- a/intl/locale/src/mac/nsDateTimeFormatMac.cpp
+++ b/intl/locale/src/mac/nsDateTimeFormatMac.cpp
@@ -201,17 +201,17 @@ nsresult nsDateTimeFormatMac::FormatTMTi
   CFDateFormatterRef formatter =
     CFDateFormatterCreate(NULL, formatterLocale, dateStyle, timeStyle);
   
   CFRelease(formatterLocale);
   
   if (dateFormatSelector == kDateFormatYearMonth ||
       dateFormatSelector == kDateFormatWeekday) {
     CFStringRef dateFormat =
-      dateFormatSelector == kDateFormatYearMonth ? CFSTR("yy/MM ") : CFSTR("EEE ");
+      dateFormatSelector == kDateFormatYearMonth ? CFSTR("yyyy/MM ") : CFSTR("EEE ");
     
     CFStringRef oldFormat = CFDateFormatterGetFormat(formatter);
     CFMutableStringRef newFormat = CFStringCreateMutableCopy(NULL, 0, oldFormat);
     CFStringInsert(newFormat, 0, dateFormat);
     CFDateFormatterSetFormat(formatter, newFormat);
     CFRelease(newFormat); // note we don't own oldFormat
   }
   
--- a/intl/locale/src/os2/nsDateTimeFormatOS2.cpp
+++ b/intl/locale/src/os2/nsDateTimeFormatOS2.cpp
@@ -87,17 +87,17 @@ nsresult nsDateTimeFormatOS2::FormatTMTi
       UniStrcat( uFmtD, (UniChar*)L"");
       break; 
     case kDateFormatLong:
     case kDateFormatShort:
       UniStrcat( uFmtD, (UniChar*)L"%x");
       break; 
     case kDateFormatYearMonth:
       UniQueryLocaleItem( locObj, DATESEP, &pString);
-      UniStrcat( uFmtD, (UniChar*)L"%y");
+      UniStrcat( uFmtD, (UniChar*)L"%Y");
       UniStrcat( uFmtD, pString);
       UniStrcat( uFmtD, (UniChar*)L"%m");
       UniFreeMem(pString);
       break; 
     case kDateFormatWeekday:
       UniStrcat( uFmtD, (UniChar*)L"%a");
       break;
     default: 
--- a/intl/locale/src/unix/nsDateTimeFormatUnix.cpp
+++ b/intl/locale/src/unix/nsDateTimeFormatUnix.cpp
@@ -204,17 +204,17 @@ nsresult nsDateTimeFormatUnix::FormatTMT
       case kDateFormatNone:
         PL_strncpy(fmtD, "", NSDATETIME_FORMAT_BUFFER_LEN);
         break; 
       case kDateFormatLong:
       case kDateFormatShort:
         PL_strncpy(fmtD, "%x", NSDATETIME_FORMAT_BUFFER_LEN);
         break; 
       case kDateFormatYearMonth:
-        PL_strncpy(fmtD, "%y/%m", NSDATETIME_FORMAT_BUFFER_LEN);
+        PL_strncpy(fmtD, "%Y/%m", NSDATETIME_FORMAT_BUFFER_LEN);
         break; 
       case kDateFormatWeekday:
         PL_strncpy(fmtD, "%a", NSDATETIME_FORMAT_BUFFER_LEN);
         break;
       default:
         PL_strncpy(fmtD, "", NSDATETIME_FORMAT_BUFFER_LEN); 
     }