Skip to content
This repository was archived by the owner on Jul 21, 2020. It is now read-only.

Commit c2271ab

Browse files
committed
Updated date parsing
1 parent 767e830 commit c2271ab

File tree

2 files changed

+4
-14
lines changed

2 files changed

+4
-14
lines changed

BeamAPI.podspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = "BeamAPI"
3-
s.version = "1.2.3"
3+
s.version = "1.2.4"
44
s.summary = "An interface to communicate with Beam's backend."
55
s.homepage = "https://github.com/WatchBeam/beam-client-swift"
66
s.license = "MIT"
@@ -9,7 +9,7 @@ Pod::Spec.new do |s|
99
s.requires_arc = true
1010
s.ios.deployment_target = "8.2"
1111
s.tvos.deployment_target = "9.0"
12-
s.source = { :git => "https://github.com/WatchBeam/beam-client-swift.git", :tag => "1.2.3" }
12+
s.source = { :git => "https://github.com/WatchBeam/beam-client-swift.git", :tag => "1.2.4" }
1313
s.source_files = "Pod/Classes/**/*"
1414

1515
s.dependency "Starscream", "~> 1.1"

Pod/Classes/Utilities/NSDate+fromBeam.swift

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,8 @@ public extension NSDate {
2323
}
2424

2525
let formatter = NSDateFormatter()
26-
formatter.dateFormat = "yyyy-MM-dd HH:mm:ss"
26+
formatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z"
2727

28-
if let date = formatter.dateFromString(string) {
29-
return date
30-
} else {
31-
formatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ssZZZZZ"
32-
33-
if let date = formatter.dateFromString(string) {
34-
return date
35-
}
36-
}
37-
38-
return nil
28+
return formatter.dateFromString(string)
3929
}
4030
}

0 commit comments

Comments
 (0)