Skip to content

Commit 5d41f3d

Browse files
* βž• add easy core dependency to remove locale duplication (#3)
* πŸ‘· configuring CI to be reusable * πŸ’š use correct name for workflow job * πŸ’š fix reusable workflow path * πŸ’š make rollback to correct path * πŸ’š remove redundant execution * βœ… fix custom formatter pass * remove pull request template * βž• add easy core dependency to remove locale duplication
1 parent 7754c09 commit 5d41f3d

5 files changed

Lines changed: 12 additions & 58 deletions

File tree

β€ŽPackage.swiftβ€Ž

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,14 @@ let package = Package(
77
products: [
88
.library(name: "EasyDate", targets: ["EasyDate"]),
99
],
10+
dependencies: [
11+
.package(
12+
url: "https://github.com/EasyPackages/EasyCore.git",
13+
.upToNextMajor(from: "0.0.1")
14+
)
15+
],
1016
targets: [
11-
.target(name: "EasyDate"),
17+
.target(name: "EasyDate", dependencies: ["EasyCore"]),
1218
.testTarget(
1319
name: "EasyDateTests",
1420
dependencies: ["EasyDate"]

β€ŽSources/EasyDate/DateFormatterExtensions.swiftβ€Ž

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
//
55

66
import Foundation
7+
import EasyCore
78

89
///
910
/// A collection of reusable and localized `DateFormatter` configurations.
@@ -30,7 +31,7 @@ public extension DateFormatter {
3031
let f = DateFormatter()
3132
f.calendar = Calendar(identifier: .iso8601)
3233
f.timeZone = .gmt
33-
f.locale = Locale(identifier: "en_US_POSIX")
34+
f.locale = Locale.enUSPOSIX
3435
f.dateFormat = "yyyy-MM-dd'T'HH:mm:ssXXXXX"
3536
return f
3637
}
@@ -46,7 +47,7 @@ public extension DateFormatter {
4647
///
4748
static var timestamp: DateFormatter {
4849
let f = DateFormatter()
49-
f.locale = Locale(identifier: "en_US_POSIX")
50+
f.locale = Locale.enUSPOSIX
5051
f.dateFormat = "yyyy-MM-dd HH:mm:ss"
5152
return f
5253
}

β€ŽSources/EasyDate/StringExtensions.swiftβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ public extension String {
106106
]
107107

108108
let formatter = DateFormatter()
109-
formatter.locale = Locale(identifier: "en_US_POSIX")
109+
formatter.locale = Locale.enUSPOSIX
110110
formatter.timeZone = .gmt
111111

112112
for format in formats {

β€ŽTests/EasyDateTests/DateFormatterExtensionsTests.swiftβ€Ž

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import Testing
22
import Foundation
3+
import EasyCore
34

45
@testable import EasyDate
56

β€ŽTests/EasyDateTests/LocaleExtensions.swiftβ€Ž

Lines changed: 0 additions & 54 deletions
This file was deleted.

0 commit comments

Comments
Β (0)