Skip to content
This repository has been archived by the owner on Jan 31, 2020. It is now read-only.

Commit

Permalink
update for Xcode 8 beta 4
Browse files Browse the repository at this point in the history
  • Loading branch information
kgn committed Aug 2, 2016
1 parent 8b096d8 commit 6f1041c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions NSDate+Extension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func NSDateTimeAgoLocalizedStrings(_ key: String) -> String {
return ""
}

let path = try! URL(fileURLWithPath: resourcePath!).appendingPathComponent("NSDateTimeAgo.bundle")
let path = URL(fileURLWithPath: resourcePath!).appendingPathComponent("NSDateTimeAgo.bundle")
guard let bundle = Bundle(url: path) else {
return ""
}
Expand Down Expand Up @@ -138,8 +138,7 @@ extension Date {
}

private func dateComponents() -> DateComponents {
let calander = Calendar.current
return calander.components([.second, .minute, .hour, .day, .month, .year], from: self, to: Date(), options: [])
return Calendar.current.dateComponents([.second, .minute, .hour, .day, .month, .year], from: self, to: Date())
}

private func string(fromFormat format: String, withValue value: Int) -> String {
Expand Down
4 changes: 2 additions & 2 deletions Tests/NSDateTimeAgoTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ class NSDateTimeAgoTests: XCTestCase {
super.tearDown()
}

func dateForComponents(block: (inout components: DateComponents) -> Void) -> Date? {
func dateForComponents(block: ( components: inout DateComponents) -> Void) -> Date? {
let calander = Calendar.current
var components = DateComponents()
block(components: &components)
return calander.date(byAdding: components, to: Date(), options: [])
return calander.date(byAdding: components, to: Date())
}

// MARK: - timeAgoSimple
Expand Down

0 comments on commit 6f1041c

Please sign in to comment.