Mercurial > dwindows
comparison mac/dw.m @ 730:d3fb3613726a
Calendar control should return years with 4 digits not 2.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Tue, 15 Mar 2011 01:13:29 +0000 |
parents | 6712e4211522 |
children | 6a589a1a42b0 |
comparison
equal
deleted
inserted
replaced
729:6712e4211522 | 730:d3fb3613726a |
---|---|
5069 NSDate *date = [calendar dateValue]; | 5069 NSDate *date = [calendar dateValue]; |
5070 NSDateFormatter *df = [[NSDateFormatter alloc] init]; | 5070 NSDateFormatter *df = [[NSDateFormatter alloc] init]; |
5071 [df setDateStyle:NSDateFormatterShortStyle]; | 5071 [df setDateStyle:NSDateFormatterShortStyle]; |
5072 NSString *nstr = [df stringFromDate:date]; | 5072 NSString *nstr = [df stringFromDate:date]; |
5073 sscanf([ nstr UTF8String ], "%d/%d/%d", month, day, year); | 5073 sscanf([ nstr UTF8String ], "%d/%d/%d", month, day, year); |
5074 if(*year < 70) | |
5075 { | |
5076 *year += 2000; | |
5077 } | |
5078 else if(*year < 100) | |
5079 { | |
5080 *year += 1900; | |
5081 } | |
5074 [df release]; | 5082 [df release]; |
5075 } | 5083 } |
5076 | 5084 |
5077 /* | 5085 /* |
5078 * Causes the embedded HTML widget to take action. | 5086 * Causes the embedded HTML widget to take action. |