Skip to content

Commit

Permalink
fix(ios): amend Date formatting for JSON
Browse files Browse the repository at this point in the history
  • Loading branch information
Gary Mathews committed Aug 27, 2019
1 parent b0cd55a commit 8d8da63
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Binary file not shown.
4 changes: 2 additions & 2 deletions iphone/TitaniumKit/TitaniumKit/Sources/API/TiUtils.m
Original file line number Diff line number Diff line change
Expand Up @@ -2120,8 +2120,8 @@ + (id)stripInvalidJSONPayload:(id)jsonPayload
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
dateFormatter.locale = [NSLocale localeWithLocaleIdentifier:@"en_US_POSIX"];
dateFormatter.timeZone = [NSTimeZone timeZoneForSecondsFromGMT:0];
// use same formatting as Android
dateFormatter.dateFormat = @"E MMM dd HH:mm:ss zzz yyyy";
// ISO08601 formatting, same as Javascript stringified new Date()
dateFormatter.dateFormat = @"yyyy-MM-dd'T'HH:mm:ss.SSS'Z'";

if ([jsonPayload isKindOfClass:[NSDictionary class]]) {
NSMutableDictionary *result = [NSMutableDictionary new];
Expand Down

0 comments on commit 8d8da63

Please sign in to comment.