My favorite tiny bit of code I wrote this week:
extension DateInterval {
init(start: Date, duration: Measurement<UnitDuration>) {
self.init(start: start,
duration: duration.converted(to: .seconds).value)
}
}
My favorite tiny bit of code I wrote this week:
extension DateInterval {
init(start: Date, duration: Measurement<UnitDuration>) {
self.init(start: start,
duration: duration.converted(to: .seconds).value)
}
}