Skip to content
Browse files

Fixes for timezone issues

  • Loading branch information...
1 parent 06a7618 commit 4f3fd72caf1e3004128e065b140d3914f41c33fb Ole Zorn committed Sep 26, 2011
Showing with 5 additions and 0 deletions.
  1. +1 −0 Classes/AppleFiscalCalendar.m
  2. +1 −0 Classes/Report.m
  3. +2 −0 Classes/ReportCSVViewController.m
  4. +1 −0 Classes/YearView.m
View
1 Classes/AppleFiscalCalendar.m
@@ -43,6 +43,7 @@ - (id)init
NSMutableArray *names = [NSMutableArray array];
NSDateFormatter *sectionTitleFormatter = [[NSDateFormatter new] autorelease];
+ [sectionTitleFormatter setTimeZone:[NSTimeZone timeZoneForSecondsFromGMT:0]];
[sectionTitleFormatter setDateFormat:@"MMMM yyyy"];
for (NSDate *date in dates) {
View
1 Classes/Report.m
@@ -613,6 +613,7 @@ - (NSArray *)allReports
- (NSString *)title
{
NSDateFormatter *dateFormatter = [[[NSDateFormatter alloc] init] autorelease];
+ [dateFormatter setTimeZone:[NSTimeZone timeZoneForSecondsFromGMT:0]];
[dateFormatter setDateStyle:NSDateFormatterShortStyle];
return [dateFormatter stringFromDate:self.startDate];
}
View
2 Classes/ReportCSVViewController.m
@@ -37,6 +37,7 @@ - (void)viewWillAppear:(BOOL)animated
{
NSDateFormatter *formatter = [[[NSDateFormatter alloc] init] autorelease];
[formatter setDateStyle:NSDateFormatterShortStyle];
+ [formatter setTimeZone:[NSTimeZone timeZoneForSecondsFromGMT:0]];
self.navigationItem.title = [formatter stringFromDate:report.startDate];
NSString *csv = [report valueForKeyPath:@"originalReport.content"];
@@ -105,6 +106,7 @@ - (id)initWithReports:(NSArray *)allReports
if (self) {
reports = [allReports retain];
dateFormatter = [[NSDateFormatter alloc] init];
+ [dateFormatter setTimeZone:[NSTimeZone timeZoneForSecondsFromGMT:0]];
[dateFormatter setDateStyle:NSDateFormatterMediumStyle];
}
return self;
View
1 Classes/YearView.m
@@ -58,6 +58,7 @@ - (void)drawRect:(CGRect)rect
NSDateFormatter *monthFormatter = [[NSDateFormatter alloc] init];
[monthFormatter setDateFormat:@"MMMM"];
+ [monthFormatter setTimeZone:[NSTimeZone timeZoneForSecondsFromGMT:0]];
NSCalendar *calendar = [[[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar] autorelease];
NSDateComponents *currentDateComponents = [calendar components:NSYearCalendarUnit | NSMonthCalendarUnit fromDate:[NSDate date]];
NSInteger currentYear = [currentDateComponents year];

0 comments on commit 4f3fd72

Please sign in to comment.
Something went wrong with that request. Please try again.