kCFCalendarUnitWeekday 和 kCFCalendarUnitDay 有什么区别?
来自文档:
kCFCalendarUnitDay
指定日单位。
和
kCFCalendarUnitWeekday
指定工作日单位。这 工作日单位是数字 1-N (对于公历,N=7 1 是星期日)。
我想要一个闹钟从周一到周五响起,我认为 kCFCalendarUnitWeekday 就是我所需要的,直到我这个周六醒来:) 有人可以解释一下这两者之间的区别吗,如文档对我来说似乎不太有帮助。
From the documentation:
kCFCalendarUnitDay
Specifies the day unit.
and
kCFCalendarUnitWeekday
Specifies the weekday unit. The
weekday units are the numbers 1-N
(where for the Gregorian calendar N=7
and 1 is Sunday).
I wanted an alarm to go off from Monday to Friday and I thought that kCFCalendarUnitWeekday
was what I needed, until I woke up this Saturday :) Can someone explain what is the difference between these two, as the documentation doesn't seem very helpful to me.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
kCFCalendarUnitDay
指定月份中的第几天,即公历中 1 到 31 之间的数字。kCFCalendarUnitWeekday
指定星期几,即公历中 1(星期日)和 7(星期六)之间的数字。你能给我们看一些代码吗?
kCFCalendarUnitDay
specifies the day of the month, i.e. a number between 1 and 31 in the Gregorian Calendar.kCFCalendarUnitWeekday
specifies the day of the week, i.e. a number between 1 (Sunday) and 7 (Saturday) in the Gregorian Calendar.Can you show us some code?