Skip to content

Commit 86be776

Browse files
Ramesikpaulb777
authored andcommitted
Always use 24-hours locale (#1947)
* Always use 24-hours locale * use en_US_POSIX instead of en_GB * Update NSDateFormatter locale for messaging tests
1 parent 2c30068 commit 86be776

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

Example/Messaging/Tests/FIRMessagingContextManagerServiceTest.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ @implementation FIRMessagingContextManagerServiceTest
3232
- (void)setUp {
3333
[super setUp];
3434
self.dateFormatter = [[NSDateFormatter alloc] init];
35+
self.dateFormatter.locale = [NSLocale localeWithLocaleIdentifier:@"en_US_POSIX"];
3536
[self.dateFormatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"];
3637
self.scheduledLocalNotifications = [NSMutableArray array];
3738
[self mockSchedulingLocalNotifications];

Firebase/Messaging/FIRMessagingContextManagerService.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ + (BOOL)handleContextManagerMessage:(NSDictionary *)message {
7878
+ (BOOL)handleContextManagerLocalTimeMessage:(NSDictionary *)message {
7979
NSString *startTimeString = message[kFIRMessagingContextManagerLocalTimeStart];
8080
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
81+
dateFormatter.locale = [NSLocale localeWithLocaleIdentifier:@"en_US_POSIX"];
8182
[dateFormatter setDateFormat:kLocalTimeFormatString];
8283
NSDate *startDate = [dateFormatter dateFromString:startTimeString];
8384

0 commit comments

Comments
 (0)