NSCalendarOptions

1,580 阅读2分钟

NSCalendarWrapComponents Specifies that the components specified for an NSDateComponents object should be incremented and wrap around to zero/one on overflow, but should not cause higher units to be incremented. 指定为NSDateComponents对象指定的组件应该递增,并在溢出时循环为零/ 1,但不应导致更高的单位增加。

NSCalendarMatchStrictly Specifies that the operation should travel as far forward or backward as necessary looking for a match. 指定操作应该根据需要前进或后退,寻找匹配。

NSCalendarSearchBackwards Specifies that the operation should travel backwards to find the previous match before the given date. 指定操作向后移动以在给定日期之前找到先前的匹配。

NSCalendarMatchPreviousTimePreservingSmallerUnits Specifies that, when there is no matching time before the end of the next instance of the next highest unit specified in the given NSDateComponents object, this method uses the previous existing value of the missing unit and preserves the lower units' values. 指定当在给定的NSDateComponents对象中指定的下一个最高单位的下一个实例的结束之前没有匹配的时间时,此方法使用缺失单元的先前存在的值,并保留较低单位的值。

NSCalendarMatchNextTimePreservingSmallerUnits Specifies that, when there is no matching time before the end of the next instance of the next highest unit specified in the given NSDateComponents object, this method uses the next existing value of the missing unit and preserves the lower units' values. 指定当在给定的NSDateComponents对象中指定的下一个最高单位的下一个实例的结束之前没有匹配的时间时,此方法使用缺少单元的下一个现有值并保留较低单位的值。

NSCalendarMatchNextTime Specifies that, when there is no matching time before the end of the next instance of the next highest unit specified in the given NSDateComponents object, this method uses the next existing value of the missing unit and does not preserve the lower units' values. 指定当在给定的NSDateComponents对象中指定的下一个最高单位的下一个实例的结束之前没有匹配的时间时,此方法使用缺少单元的下一个现有值,并且不保留较低单位的值。

NSCalendarMatchFirst Specifies that, if there are two or more matching times, the operation should return the first occurrence. 指定如果有两个或更多匹配的时间,操作应该返回第一个出现的。

NSCalendarMatchLast Specifies that, if there are two or more matching times, the operation should return the last occurrence. 指定如果有两个或更多匹配的时间,则操作应返回最后一次出现的。