Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion Clock Bar App/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ @implementation AppDelegate
NSString *STATUS_ICON_BLACK = @"clock-64";

NSDateFormatter *timeformatter;
NSString *format = @"hh:mm";
NSString *format;
NSMutableAttributedString *colorTitle;


Expand Down Expand Up @@ -101,6 +101,12 @@ - (void)applicationDidFinishLaunching:(NSNotification *)aNotification {

DFRSystemModalShowsCloseBoxWhenFrontMost(YES);

if ([[NSUserDefaults standardUserDefaults] stringForKey:@"format"] == nil) {
[[NSUserDefaults standardUserDefaults] setObject:@"hh:mm" forKey:@"format"];
[[NSUserDefaults standardUserDefaults] synchronize];
}
format = [[NSUserDefaults standardUserDefaults] stringForKey:@"format"];

timeformatter = [[NSDateFormatter alloc] init];
[timeformatter setTimeStyle: NSDateFormatterShortStyle];
[timeformatter setDateFormat:format];
Expand Down Expand Up @@ -194,6 +200,7 @@ - (void)onPressed:(TouchButton*)sender
format = @"hh:mm";
}
[timeformatter setDateFormat:format];
[[NSUserDefaults standardUserDefaults] setObject:format forKey:@"format"];
}

- (void)onLongPressed:(TouchButton*)sender
Expand Down