Skip to content

Commit

Permalink
Fix date: Save state
Browse files Browse the repository at this point in the history
- Make sure to use local time
  • Loading branch information
anjerodesu committed Dec 31, 2015
1 parent 686a96d commit 3cf0372
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions OpenEmu/OEGameDocument.m
Original file line number Diff line number Diff line change
Expand Up @@ -1209,10 +1209,13 @@ - (void)saveState:(id)sender
BOOL didPauseEmulation = [self OE_pauseEmulationIfNeeded];

NSInteger saveGameNo = [[self rom] saveStateCount] + 1;
// TODO: properly format date
NSDate *date = [NSDate date];
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
formatter.timeZone = [NSTimeZone localTimeZone];
formatter.dateFormat = @"yyyy-MM-dd HH:mm:ss ZZZ";

NSString *format = NSLocalizedString(@"Save-Game-%ld %@", @"default save game name");
NSString *proposedName = [NSString stringWithFormat:format, saveGameNo, date];
NSString *proposedName = [NSString stringWithFormat:format, saveGameNo, [formatter stringFromDate:date]];
OEHUDAlert *alert = [OEHUDAlert saveGameAlertWithProposedName:proposedName];

[alert setWindow:[[[self gameViewController] view] window]];
Expand Down

0 comments on commit 3cf0372

Please sign in to comment.