Author: dpsimons
Date: Thu Feb 18 23:33:36 2016
New Revision: 39396

URL: http://svn.gna.org/viewcvs/gnustep?rev=39396&view=rev
Log:
fix the weekday names methods to ignore the empty first item returned by icu

Modified:
    libs/base/branches/gnustep_testplant_branch/ChangeLog
    libs/base/branches/gnustep_testplant_branch/Source/NSDateFormatter.m

Modified: libs/base/branches/gnustep_testplant_branch/ChangeLog
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/base/branches/gnustep_testplant_branch/ChangeLog?rev=39396&r1=39395&r2=39396&view=diff
==============================================================================
--- libs/base/branches/gnustep_testplant_branch/ChangeLog       (original)
+++ libs/base/branches/gnustep_testplant_branch/ChangeLog       Thu Feb 18 
23:33:36 2016
@@ -1,3 +1,8 @@
+2016-02-18  Doug Simons <[email protected]>
+
+       * NSDateFormatter.m: Fixed the weekday names methods. The ICU weekday
+          names arrays all contain 8 items, with the first one empty. Go 
figure.
+          
 2015-07-29  Doug Simons <[email protected]>
 
        * NSTask.m: Fixed launch method to throw an exception on Windows when it

Modified: libs/base/branches/gnustep_testplant_branch/Source/NSDateFormatter.m
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/base/branches/gnustep_testplant_branch/Source/NSDateFormatter.m?rev=39396&r1=39395&r2=39396&view=diff
==============================================================================
--- libs/base/branches/gnustep_testplant_branch/Source/NSDateFormatter.m        
(original)
+++ libs/base/branches/gnustep_testplant_branch/Source/NSDateFormatter.m        
Thu Feb 18 23:33:36 2016
@@ -568,7 +568,8 @@
 - (NSArray *) weekdaySymbols
 {
 #if GS_USE_ICU == 1
-  return [self _getSymbols: UDAT_WEEKDAYS];
+  NSArray *array = [self _getSymbols: UDAT_WEEKDAYS];
+  return ([array count] == 8 ? [array subarrayWithRange:NSMakeRange(1,7)] : 
array);
 #else
   return nil;
 #endif
@@ -586,7 +587,8 @@
 - (NSArray *) shortWeekdaySymbols
 {
 #if GS_USE_ICU == 1
-  return [self _getSymbols: UDAT_SHORT_WEEKDAYS];
+  NSArray *array = [self _getSymbols: UDAT_SHORT_WEEKDAYS];
+  return ([array count] == 8 ? [array subarrayWithRange:NSMakeRange(1,7)] : 
array);
 #else
   return nil;
 #endif
@@ -595,7 +597,7 @@
 - (void) setShortWeekdaySymbols: (NSArray *) array
 {
 #if GS_USE_ICU == 1
-  [self _getSymbols: UDAT_SHORT_WEEKDAYS];
+  [self _setSymbols: array : UDAT_SHORT_WEEKDAYS];
 #else
   return;
 #endif
@@ -613,7 +615,7 @@
 - (void) setMonthSymbols: (NSArray *) array
 {
 #if GS_USE_ICU == 1
-  [self _getSymbols: UDAT_MONTHS];
+  [self _setSymbols: array : UDAT_MONTHS];
 #else
   return;
 #endif
@@ -631,7 +633,7 @@
 - (void) setShortMonthSymbols: (NSArray *) array
 {
 #if GS_USE_ICU == 1
-  [self _getSymbols: UDAT_SHORT_MONTHS];
+  [self _setSymbols: array : UDAT_SHORT_MONTHS];
 #else
   return;
 #endif
@@ -831,7 +833,8 @@
 - (NSArray *) shortStandaloneWeekdaySymbols
 {
 #if GS_USE_ICU == 1
-  return [self _getSymbols: UDAT_STANDALONE_SHORT_WEEKDAYS];
+  NSArray *array = [self _getSymbols: UDAT_STANDALONE_SHORT_WEEKDAYS];
+  return ([array count] == 8 ? [array subarrayWithRange:NSMakeRange(1,7)] : 
array);
 #else
   return nil;
 #endif
@@ -849,7 +852,8 @@
 - (NSArray *) standaloneWeekdaySymbols
 {
 #if GS_USE_ICU == 1
-  return [self _getSymbols: UDAT_STANDALONE_WEEKDAYS];
+  NSArray *array = [self _getSymbols: UDAT_STANDALONE_WEEKDAYS];
+  return ([array count] == 8 ? [array subarrayWithRange:NSMakeRange(1,7)] : 
array);
 #else
   return nil;
 #endif
@@ -867,7 +871,8 @@
 - (NSArray *) veryShortWeekdaySymbols
 {
 #if GS_USE_ICU == 1
-  return [self _getSymbols: UDAT_SHORT_WEEKDAYS];
+  NSArray *array = [self _getSymbols: UDAT_SHORT_WEEKDAYS];
+  return ([array count] == 8 ? [array subarrayWithRange:NSMakeRange(1,7)] : 
array);
 #else
   return nil;
 #endif
@@ -885,7 +890,8 @@
 - (NSArray *) veryShortStandaloneWeekdaySymbols
 {
 #if GS_USE_ICU == 1
-  return [self _getSymbols: UDAT_STANDALONE_NARROW_WEEKDAYS];
+  NSArray *array = [self _getSymbols: UDAT_STANDALONE_NARROW_WEEKDAYS];
+  return ([array count] == 8 ? [array subarrayWithRange:NSMakeRange(1,7)] : 
array);
 #else
   return nil;
 #endif


_______________________________________________
Gnustep-cvs mailing list
[email protected]
https://mail.gna.org/listinfo/gnustep-cvs

Reply via email to