Skip to content

Commit 9ef5c33

Browse files
committed
rename dateFormatter to sqlDateFormatter
1 parent a1ed3ce commit 9ef5c33

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

Sources/SQLite/Foundation.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,19 +49,19 @@ extension Date : Value {
4949
}
5050

5151
public static func fromDatatypeValue(_ stringValue: String) -> Date {
52-
return dateFormatter.date(from: stringValue)!
52+
return sqlDateFormatter.date(from: stringValue)!
5353
}
5454

5555
public var datatypeValue: String {
56-
return dateFormatter.string(from: self)
56+
return sqlDateFormatter.string(from: self)
5757
}
5858

5959
}
6060

6161
/// A global date formatter used to serialize and deserialize `NSDate` objects.
6262
/// If multiple date formats are used in an application’s database(s), use a
6363
/// custom `Value` type per additional format.
64-
public var dateFormatter: DateFormatter = {
64+
public var sqlDateFormatter: DateFormatter = {
6565
let formatter = DateFormatter()
6666
formatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSS"
6767
formatter.locale = Locale(identifier: "en_US_POSIX")

Sources/SQLite/Typed/DateAndTimeFunctions.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,19 +71,19 @@ public class DateFunctions {
7171

7272
extension Date {
7373
public var date: Expression<Date?> {
74-
return DateFunctions.date(dateFormatter.string(from: self))
74+
return DateFunctions.date(sqlDateFormatter.string(from: self))
7575
}
7676

7777
public var time: Expression<Date?> {
78-
return DateFunctions.time(dateFormatter.string(from: self))
78+
return DateFunctions.time(sqlDateFormatter.string(from: self))
7979
}
8080

8181
public var datetime: Expression<Date?> {
82-
return DateFunctions.datetime(dateFormatter.string(from: self))
82+
return DateFunctions.datetime(sqlDateFormatter.string(from: self))
8383
}
8484

8585
public var julianday: Expression<Date?> {
86-
return DateFunctions.julianday(dateFormatter.string(from: self))
86+
return DateFunctions.julianday(sqlDateFormatter.string(from: self))
8787
}
8888
}
8989

0 commit comments

Comments
 (0)