Skip to content
8 changes: 7 additions & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,14 @@ let package = Package(
products: [
.library(name: "EasyDate", targets: ["EasyDate"]),
],
dependencies: [
.package(
url: "https://github.com/EasyPackages/EasyCore.git",
.upToNextMajor(from: "0.0.1")
)
],
targets: [
.target(name: "EasyDate"),
.target(name: "EasyDate", dependencies: ["EasyCore"]),
.testTarget(
name: "EasyDateTests",
dependencies: ["EasyDate"]
Expand Down
5 changes: 3 additions & 2 deletions Sources/EasyDate/DateFormatterExtensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
//

import Foundation
import EasyCore

///
/// A collection of reusable and localized `DateFormatter` configurations.
Expand All @@ -30,7 +31,7 @@ public extension DateFormatter {
let f = DateFormatter()
f.calendar = Calendar(identifier: .iso8601)
f.timeZone = .gmt
f.locale = Locale(identifier: "en_US_POSIX")
f.locale = Locale.enUSPOSIX
f.dateFormat = "yyyy-MM-dd'T'HH:mm:ssXXXXX"
return f
}
Expand All @@ -46,7 +47,7 @@ public extension DateFormatter {
///
static var timestamp: DateFormatter {
let f = DateFormatter()
f.locale = Locale(identifier: "en_US_POSIX")
f.locale = Locale.enUSPOSIX
f.dateFormat = "yyyy-MM-dd HH:mm:ss"
return f
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/EasyDate/StringExtensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public extension String {
]

let formatter = DateFormatter()
formatter.locale = Locale(identifier: "en_US_POSIX")
formatter.locale = Locale.enUSPOSIX
formatter.timeZone = .gmt

for format in formats {
Expand Down
1 change: 1 addition & 0 deletions Tests/EasyDateTests/DateFormatterExtensionsTests.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import Testing
import Foundation
import EasyCore

@testable import EasyDate

Expand Down
54 changes: 0 additions & 54 deletions Tests/EasyDateTests/LocaleExtensions.swift

This file was deleted.