Skip to content

Commit 92c232f

Browse files
committed
Update to DateOperations 2.0
1 parent cc446ef commit 92c232f

File tree

7 files changed

+45
-46
lines changed

7 files changed

+45
-46
lines changed

Package.resolved

Lines changed: 30 additions & 31 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Package.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
// swift-tools-version:5.5
1+
// swift-tools-version:6.0
22
// The swift-tools-version declares the minimum version of Swift required to build this package.
33

44
import PackageDescription
55

66
let package = Package(
77
name: "DataTransferObjects",
88
platforms: [
9-
.macOS(.v11),
9+
.macOS(.v13),
1010
.iOS(.v14),
1111
],
1212
products: [
@@ -19,7 +19,7 @@ let package = Package(
1919
dependencies: [
2020
// Dependencies declare other packages that this package depends on.
2121
// .package(url: /* package url */, from: "1.0.0"),
22-
.package(url: "https://github.com/TelemetryDeck/SwiftDateOperations.git", from: "1.0.5"),
22+
.package(url: "https://github.com/TelemetryDeck/SwiftDateOperations.git", from: "2.0.0"),
2323
.package(url: "https://github.com/apple/swift-crypto.git", from: "3.8.0"),
2424
],
2525
targets: [

Sources/DataTransferObjects/Query/QueryTimeInterval.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ public struct QueryTimeInterval: Codable, Hashable, Equatable, Comparable, Senda
1717
public func encode(to encoder: Encoder) throws {
1818
var container = encoder.singleValueContainer()
1919

20-
let date1 = Formatter.iso8601.string(from: beginningDate)
21-
let date2 = Formatter.iso8601.string(from: endDate)
20+
let date1 = Formatter.iso8601().string(from: beginningDate)
21+
let date2 = Formatter.iso8601().string(from: endDate)
2222

2323
try container.encode(date1 + "/" + date2)
2424
}
@@ -31,8 +31,8 @@ public struct QueryTimeInterval: Codable, Hashable, Equatable, Comparable, Senda
3131

3232
guard let beginningString = intervalArray.first,
3333
let endString = intervalArray.last,
34-
let beginningDate = Formatter.iso8601.date(from: beginningString) ?? Formatter.iso8601noFS.date(from: beginningString) ?? Formatter.iso8601dateOnly.date(from: beginningString),
35-
let endDate = Formatter.iso8601.date(from: endString) ?? Formatter.iso8601noFS.date(from: endString) ?? Formatter.iso8601dateOnly.date(from: endString)
34+
let beginningDate = Formatter.iso8601().date(from: beginningString) ?? Formatter.iso8601noFS().date(from: beginningString) ?? Formatter.iso8601dateOnly().date(from: beginningString),
35+
let endDate = Formatter.iso8601().date(from: endString) ?? Formatter.iso8601noFS().date(from: endString) ?? Formatter.iso8601dateOnly().date(from: endString)
3636
else {
3737
throw DecodingError.dataCorrupted(.init(
3838
codingPath: [],

Tests/QueryResultTests/TopNResultTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ import DataTransferObjects
99
import XCTest
1010

1111
class TopNResultTests: XCTestCase {
12-
static let firstMonthDate: Date = Formatter.iso8601.date(from: "2021-12-01T00:00:00.000Z")!
13-
static let secondMonthDate: Date = Formatter.iso8601.date(from: "2022-01-01T00:00:00.000Z")!
12+
static let firstMonthDate: Date = Formatter.iso8601().date(from: "2021-12-01T00:00:00.000Z")!
13+
static let secondMonthDate: Date = Formatter.iso8601().date(from: "2022-01-01T00:00:00.000Z")!
1414

1515
let emptyResult = """
1616
[

Tests/QueryTests/FilterTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ class FilterTests: XCTestCase {
2626
"""
2727
.filter { !$0.isWhitespace }
2828

29-
let beginDate: Date = Formatter.iso8601.date(from: "2014-10-01T00:00:00.000Z")!
30-
let endDate: Date = Formatter.iso8601.date(from: "2014-10-07T00:00:00.000Z")!
29+
let beginDate: Date = Formatter.iso8601().date(from: "2014-10-01T00:00:00.000Z")!
30+
let endDate: Date = Formatter.iso8601().date(from: "2014-10-07T00:00:00.000Z")!
3131

3232
let exampleFilterInterval = Filter.interval(FilterInterval(
3333
dimension: "__time",

Tests/QueryTests/HashingTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ import DataTransferObjects
99
import XCTest
1010

1111
class HashingTests: XCTestCase {
12-
static let beginDate: Date = Formatter.iso8601.date(from: "2021-12-03T00:00:00.000Z")!
13-
static let endDate: Date = Formatter.iso8601.date(from: "2022-01-31T22:59:59.999Z")!
12+
static let beginDate: Date = Formatter.iso8601().date(from: "2021-12-03T00:00:00.000Z")!
13+
static let endDate: Date = Formatter.iso8601().date(from: "2022-01-31T22:59:59.999Z")!
1414

1515
func testSQLQueryHashingNonEquals() {
1616
let exampleQuery1 = """

Tests/QueryTests/TopNQueryTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ class TopNQueryTests: XCTestCase {
2525
}
2626
"""
2727

28-
static let beginDate: Date = Formatter.iso8601.date(from: "2021-12-03T00:00:00.000Z")!
29-
static let endDate: Date = Formatter.iso8601.date(from: "2022-01-31T22:59:59.999Z")!
28+
static let beginDate: Date = Formatter.iso8601().date(from: "2021-12-03T00:00:00.000Z")!
29+
static let endDate: Date = Formatter.iso8601().date(from: "2022-01-31T22:59:59.999Z")!
3030

3131
let exampleTopNQuery = CustomQuery(
3232
queryType: .topN,

0 commit comments

Comments
 (0)