Closed timbms closed 1 year ago
For my app with a target of iOS version > 15, I switched to the Foundation Formatter API
let isoFormatStyle: Date.ISO8601FormatStyle = .iso8601
.day()
.month()
.year()
.time(includingFractionalSeconds: true)
.timeZone(separator: .omitted)
let startDateString = startDate.formatted(isoFormatStyle)
let endDateString = endDate.formatted(isoFormatStyle)
var query = """
from(bucket: "\(bucket)")
|> range(start: \(startDateString), stop: \(endDateString))
Therefore, the issue can be closed.
Proposal: Make OpenISO8601DateFormatter part of InfluxDBSwift
Current behavior: Preparing a flux query frequently requires setting start/stop from Date
|> range(start: \(formatter.string(from: startDate)) , stop: \(formatter.string(from: endDate)) )
The formatter needs to adhere to the InfluxDB specs.Desired behavior: Access OpenISO8601DateFormatter without the need to recreate in program.
Use case: Convenience for API