SwiftDate’s DateInRegion quarter is always 0

115 views Asked by At

I’m trying to get the quarter of the year for a date but always getting a zero value when using the .quarter property. Is this a known issue or am I doing something incorrectly?

Sample Code using SwiftDate 5.x:

SwiftDate.defaultRegion = Region.current
let today = DateInRegion()
print(“Quarter = \(today.quarter)”)
1

There are 1 answers

0
keno On BEST ANSWER

This got addressed in v5.0.9 of the SwiftDate library.

https://github.com/malcommac/SwiftDate/issues/585