[英]Swift: Why DateComponentsFormatter.localizedString(from:unitsStyle:) does not work for weekday?
为什么
DateComponentsFormatter.localizedString(from:unitsStyle:)<\/code>在
weekday<\/code>不起作用?
let twoDays = DateComponents(day: 2)
let threeWeeks = DateComponents(weekday: 3)
Text(DateComponentsFormatter.localizedString(from: twoDays, unitsStyle: .full) ?? "found nil") // returns "2 days"
Text(DateComponentsFormatter.localizedString(from: threeWeeks, unitsStyle: .full) ?? "found nil") // returns "found nil"
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.