简体   繁体   English

SwiftDate的DateInRegion季度始终为0

[英]SwiftDate’s DateInRegion quarter is always 0

I'm trying to get the quarter of the year for a date but always getting a zero value when using the .quarter property. 我正在尝试获取日期的季度,但使用.quarter属性时始终将值设置为零。 Is this a known issue or am I doing something incorrectly? 这是一个已知问题还是我做错了什么?

Sample Code using SwiftDate 5.x: 使用SwiftDate 5.x的示例代码:

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

This got addressed in v5.0.9 of the SwiftDate library. SwiftDate库的v5.0.9版对此进行了解决。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM