From 67ee1eaf7bcbad29b0655d7d46876021f8c5d009 Mon Sep 17 00:00:00 2001 From: Niels Grewe Date: Tue, 28 Apr 2015 15:18:47 +0000 Subject: [PATCH] Fix a bug where the date format of the the formatter was reset when you called -setTimeZone: -setLocale: or similar methods that require recreating the UDateFormat (i.e. with ICU). git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@38463 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 5 +++++ Source/NSDateFormatter.m | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index e4a99ca3d..e018c30b0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2015-04-28 Niels Grewe + + * Source/NSDateFormatter.m: Properly reinstall the user provided + date format when we need to recreate the icu-based date formatter. + 2015-04-02 Richard Frith-Macdonald * Source/NSThread.m: If an exception occurs while performing a diff --git a/Source/NSDateFormatter.m b/Source/NSDateFormatter.m index a0c4c6fe6..a64c220d4 100644 --- a/Source/NSDateFormatter.m +++ b/Source/NSDateFormatter.m @@ -986,7 +986,11 @@ static NSDateFormatterBehavior _defaultBehavior = 0; &err); if (U_FAILURE(err)) internal->_formatter = NULL; - + if (nil != self->_dateFormat) + { + // Set the date format to the user provide one + [self setDateFormat: _dateFormat]; + } NSZoneFree ([self zone], tzID); #else return;