Skip to content

Commit 9ec8afb

Browse files
authored
Merge pull request #322 from zapcannon87/developer
fix(date): format representation string of date is incorrect in some region
2 parents 13c7f13 + d035950 commit 9ec8afb

File tree

4 files changed

+16
-2
lines changed

4 files changed

+16
-2
lines changed

LeanCloudTests/BaseTestCase.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,14 @@ class BaseTestCase: XCTestCase {
4646
id: BaseTestCase.cnApp.id,
4747
key: BaseTestCase.cnApp.key,
4848
serverURL: BaseTestCase.cnApp.serverURL)
49+
50+
// var config = LCApplication.Configuration()
51+
// config.RTMCustomServerURL = RTMBaseTestCase.testableRTMURL
52+
// try! LCApplication.default.set(
53+
// id: BaseTestCase.cnApp.id,
54+
// key: BaseTestCase.cnApp.key,
55+
// serverURL: BaseTestCase.cnApp.serverURL,
56+
// configuration: config)
4957
}
5058

5159
override class func tearDown() {

LeanCloudTests/IMConversationTestCase.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -685,6 +685,7 @@ class IMConversationTestCase: RTMBaseTestCase {
685685
}
686686
wait(for: [largeUnreadExp], timeout: timeout)
687687

688+
delay()
688689
XCTAssertNotNil(clientB.lastUnreadNotifTime)
689690

690691
let allReadExp = expectation(description: "all read")

Sources/Foundation/Date.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ public final class LCDate: NSObject, LCValue, LCValueExtension {
1818

1919
static let dateFormatter: DateFormatter = {
2020
let formatter = DateFormatter()
21-
formatter.dateFormat = "yyyy'-'MM'-'dd'T'HH':'mm':'ss.SSS'Z'"
21+
formatter.locale = Locale(identifier: "en_US_POSIX")
22+
formatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"
2223
formatter.timeZone = TimeZone(secondsFromGMT: 0)
2324
return formatter
2425
}()

main.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,12 +462,15 @@ class JazzyTask: Task {
462462
toPath: APIDocsRepoSwiftDirectory)
463463
}
464464

465-
static func commitPush() throws {
465+
static func commitPull() throws {
466466
guard GitTask(arguments: [
467467
"-C", APIDocsRepoSwiftDirectory, "pull"])
468468
.excute() else {
469469
throw TaskError()
470470
}
471+
}
472+
473+
static func commitPush() throws {
471474
guard GitTask(arguments: [
472475
"-C", APIDocsRepoSwiftDirectory,
473476
"add", "-A"])
@@ -490,6 +493,7 @@ class JazzyTask: Task {
490493
static func update(currentVersion: VersionUpdater.Version) throws {
491494
try version()
492495
try checkAPIDocsRepoSwiftDirectory()
496+
try commitPull()
493497
try generateDocumentation(currentVersion: currentVersion)
494498
try moveGeneratedDocumentationToRepo()
495499
try commitPush()

0 commit comments

Comments
 (0)