Browse Source

Using Locale's date format.

Localization
Abhishek Banthia 9 years ago
parent
commit
7cce48e515
  1. BIN
      Clocker.xcodeproj/project.xcworkspace/xcuserdata/abhishekbanthia.xcuserdatad/UserInterfaceState.xcuserstate
  2. 18
      Clocker.xcodeproj/xcuserdata/abhishekbanthia.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
  3. 3
      Clocker.xcodeproj/xcuserdata/abhishekbanthia.xcuserdatad/xcschemes/Clocker.xcscheme
  4. 9
      Clocker/PanelController.m

BIN
Clocker.xcodeproj/project.xcworkspace/xcuserdata/abhishekbanthia.xcuserdatad/UserInterfaceState.xcuserstate generated

Binary file not shown.

18
Clocker.xcodeproj/xcuserdata/abhishekbanthia.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

@ -2,22 +2,4 @@
<Bucket <Bucket
type = "1" type = "1"
version = "2.0"> version = "2.0">
<Breakpoints>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "Clocker/PanelController.m"
timestampString = "469425307.272762"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "256"
endingLineNumber = "256"
landmarkName = "-tableView:viewForTableColumn:row:"
landmarkType = "5">
</BreakpointContent>
</BreakpointProxy>
</Breakpoints>
</Bucket> </Bucket>

3
Clocker.xcodeproj/xcuserdata/abhishekbanthia.xcuserdatad/xcschemes/Clocker.xcscheme

@ -52,7 +52,8 @@
debugServiceExtension = "internal" debugServiceExtension = "internal"
allowLocationSimulation = "YES" allowLocationSimulation = "YES"
showNonLocalizedStrings = "YES" showNonLocalizedStrings = "YES"
language = "fr"> language = "fr"
region = "PK">
<BuildableProductRunnable <BuildableProductRunnable
runnableDebuggingMode = "0"> runnableDebuggingMode = "0">
<BuildableReference <BuildableReference

9
Clocker/PanelController.m

@ -297,11 +297,13 @@
NSNumber *is24HourFormatSelected = [[NSUserDefaults standardUserDefaults] objectForKey:@"is24HourFormatSelected"]; NSNumber *is24HourFormatSelected = [[NSUserDefaults standardUserDefaults] objectForKey:@"is24HourFormatSelected"];
is24HourFormatSelected.boolValue ? [dateFormatter setDateFormat:@"HH:mm"] : [dateFormatter setTimeStyle:NSDateFormatterShortStyle]; is24HourFormatSelected.boolValue ? [dateFormatter setDateFormat:@"HH:mm"] : [dateFormatter setDateFormat:@"hh:mm"];
dateFormatter.timeZone = [NSTimeZone timeZoneWithName:timezoneName]; dateFormatter.timeZone = [NSTimeZone timeZoneWithName:timezoneName];
//In the format 22:10 //In the format 22:10
NSLog(@"Time:%@", [dateFormatter stringFromDate:currentDate]);
return [dateFormatter stringFromDate:currentDate]; return [dateFormatter stringFromDate:currentDate];
} }
@ -321,14 +323,13 @@
- (NSString *)compareSystemDate:(NSString *)systemDate toTimezoneDate:(NSString *)date - (NSString *)compareSystemDate:(NSString *)systemDate toTimezoneDate:(NSString *)date
{ {
NSDateFormatter *formatter = [[NSDateFormatter alloc] init]; NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
formatter.dateFormat = @"MM/dd/yyyy"; formatter.dateFormat = [NSDateFormatter dateFormatFromTemplate:@"MM/dd/yyyy" options:0 locale:[NSLocale currentLocale]];
formatter.dateFormat = @"dd/MM/yyyy";
NSDate *localDate = [formatter dateFromString:systemDate]; NSDate *localDate = [formatter dateFromString:systemDate];
NSDate *timezoneDate = [formatter dateFromString:date]; NSDate *timezoneDate = [formatter dateFromString:date];
if (localDate == nil || timezoneDate == nil) { if (localDate == nil || timezoneDate == nil) {
// [[Crashlytics sharedInstance] crash]; [[Crashlytics sharedInstance] crash];
[CrashlyticsKit setUserEmail:systemDate]; [CrashlyticsKit setUserEmail:systemDate];
[CrashlyticsKit setUserIdentifier:date]; [CrashlyticsKit setUserIdentifier:date];
NSLog(@"One of the dates is nil"); NSLog(@"One of the dates is nil");

Loading…
Cancel
Save