Skip to content

Commit

Permalink
Added support for WatchOS
Browse files Browse the repository at this point in the history
  • Loading branch information
salling committed Feb 22, 2022
1 parent 6408d34 commit 3f184d9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion URLQueryItemEncoder/URLQueryItemEncoder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ protocol URLQueryItemEncoderDateFormatter {
}

extension DateFormatter: URLQueryItemEncoderDateFormatter {}
@available(watchOS 3.0, *)
@available(iOS 10.0, iOSApplicationExtension 10.0, macOS 10.12, *)
extension ISO8601DateFormatter: URLQueryItemEncoderDateFormatter {}

Expand All @@ -25,7 +26,7 @@ let iso8601Formatter: URLQueryItemEncoderDateFormatter = {
formatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"
return formatter
#else
if #available(iOS 11.0, macOS 10.13, *) {
if #available(iOS 11.0, macOS 10.13, *), #available(watchOS 4.0, *) {
var formatter = ISO8601DateFormatter()
formatter.formatOptions.formUnion([.withFractionalSeconds])
return formatter
Expand Down

0 comments on commit 3f184d9

Please sign in to comment.