From c1ecdb91acada32a6636b3f90bcc8c0385a300c6 Mon Sep 17 00:00:00 2001 From: richard Date: Tue, 20 Jul 1999 14:35:13 +0000 Subject: [PATCH] Minor fix to use default local when parsing a string. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@4629 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 5 +++++ Source/NSCalendarDate.m | 8 +++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 38def56dd..eaa8465b8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Tue Jul 20 15:45:00 1999 Richard Frith-Macdonald + + * Source/NSCalendarDate.m: ([initWithString:calendarFormat:locale:]) + updated to get default format and locale info. + Tue Jul 20 10:12:00 1999 Richard Frith-Macdonald * Source/NSString.m: Update code for standardising paths - now diff --git a/Source/NSCalendarDate.m b/Source/NSCalendarDate.m index 09e570fb7..67709e9cc 100644 --- a/Source/NSCalendarDate.m +++ b/Source/NSCalendarDate.m @@ -196,9 +196,11 @@ if (!description) [NSException raise: NSInvalidArgumentException format: @"NSCalendar date description is nil"]; - if (!format) - [NSException raise: NSInvalidArgumentException - format: @"NSCalendar date format is nil"]; + + if (locale == nil) + locale = [[NSUserDefaults standardUserDefaults] dictionaryRepresentation]; + if (format == nil) + format = [locale objectForKey: NSTimeDateFormatString]; // The strftime specifiers // %a abbreviated weekday name according to locale