为iOS提供日期处理助手。
- (NSDate *)DRDateHelpers_dateByAddingDays:(NSInteger)daysCount timeZone:(NSTimeZone *)timeZone;
- (NSDate *)DRDateHelpers_dateByAddingWeeks:(NSInteger)weeksCount timeZone:(NSTimeZone *)timeZone;
- (NSDate *)DRDateHelpers_dateByAddingMonths:(NSInteger)monthsCount timeZone:(NSTimeZone *)timeZone;
NSLocale
来支持不同星期第一天顺序的区域设置- (NSDate *)DRDateHelpers_beginningOfDayWithTimeZone:(NSTimeZone *)timeZone;
- (NSDate *)DRDateHelpers_endOfDayWithTimeZone:(NSTimeZone *)timeZone;
- (NSDate *)DRDateHelpers_beginningOfWeekWithTimeZone:(NSTimeZone *)timeZone locale:(NSLocale *)locale;
- (NSDate *)DRDateHelpers_endOfWeekWithTimeZone:(NSTimeZone *)timeZone locale:(NSLocale *)locale;
- (NSDate *)DRDateHelpers_beginningOfMonthWithTimeZone:(NSTimeZone *)timeZone;
- (NSDate *)DRDateHelpers_endOfMonthWithTimeZone:(NSTimeZone *)timeZone;
您可以使用Cocoapods将DRDateHelpers
集成到项目中。为此,您需要在Podfile中添加以下一行之一
对于稳定版本(推荐)
pod 'DRDateHelpers', '~> 1.0.1'
创建对版本>= 1.0.1
和< 1.1
的依赖
对于最新或特定开发版本(不建议在生产环境中使用)
pod 'DRDateHelpers', :git => 'https://github.com/darrarski/DRDateHelpers-iOS.git', :tag => 'VERSION_TAG'
在这里,VERSION_TAG
应该放置给定版本的标签名(例如,“v1.0.1”)。建议明确设置版本,而不是使用最新版本,因为不保证向下兼容性。
您还可以从发布页面下载指定版本的zip存档。
在示例项目中实现了单元测试。
MIT许可(MIT) - 请参阅包含的LICENSE文件。