mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
Set minimum days in first week so we number weeks in December 2012 from 0
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@36398 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
5db83d1282
commit
cb1874874d
1 changed files with 4 additions and 2 deletions
|
@ -22,14 +22,16 @@ int main()
|
|||
if (!NSCALENDAR_SUPPORTED)
|
||||
SKIP("NSCalendar not supported\nThe ICU library was not available when GNUstep-base was built")
|
||||
|
||||
cal = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar];
|
||||
cal = [[NSCalendar alloc] initWithCalendarIdentifier: NSGregorianCalendar];
|
||||
|
||||
[cal setMinimumDaysInFirstWeek: 4];
|
||||
[cal setFirstWeekday: 1];
|
||||
|
||||
date = [NSDate dateWithString: @"2012-12-31 13:57:00 +0100"];
|
||||
|
||||
comps = [cal components: NSYearForWeekOfYearCalendarUnit
|
||||
| NSWeekOfYearCalendarUnit | NSWeekOfMonthCalendarUnit
|
||||
fromDate: date];
|
||||
|
||||
PASS([comps weekOfMonth] == 5, "-weekOfMonth returns the correct week");
|
||||
PASS([comps weekOfYear] == 1, "-weekOfYear returns the correct week");
|
||||
PASS([comps yearForWeekOfYear] == 2013,
|
||||
|
|
Loading…
Reference in a new issue