belkevich / nsdate-calendar Goto Github PK
View Code? Open in Web Editor NEWNSDate categories to access date components and many more
License: MIT License
NSDate categories to access date components and many more
License: MIT License
myDate.dateWeekEnd returns date less then date of called object myDate
Not really an issue more of a comment, but just wanted to say THANK YOU for the life saver. I unintentionally wound up using a bunch of iOS 8 methods in an app that needs to still support iOS 6 & 7.
Thanks to your library, even my iOS 8 code is much cleaner!
Hello!
I'm trying to use the dateBySetting... methods to change only the time component of a date, and it's clobbering the date.
NSDate *now = [NSDate date];
NSLog(@"now; %@", now);
NSDate *dateChangedHour = [now dateBySettingHour:6];
NSLog(@"dateBySettingHour; %@", dateChangedHour);
2014-02-06 10:53:16.962 Test[2738:60b] now; 2014-02-06 16:53:16 +0000
2014-02-06 10:53:16.964 Test[2738:60b] dateBySettingHour; 0001-01-01 12:43:52 +0000
I get the expected output switching dateComponentsTime for dateComponentsDateTime;
NSDateComponents *components = [now dateComponentsDateTime];
components.hour = 6;
NSDate *setHour = [[NSCalendar currentCalendar] dateFromComponents:components];
NSLog(@"setHour; %@", setHour);
2014-02-06 10:53:16.965 Test[2738:60b] setHour; 2014-02-06 12:53:16 +0000
Am I using this wrong? The readme shows it keeping the date intact and only changing the time.
Thanks!
Why plural for days but not for the others ?
- (NSDate *)dateByAddingMonth:(NSInteger)month;
I have problem with Russian calendar and the first day of the week. For example, today is 20.03.2016, ENG first week day is 1 and RUS is 2.
With your expression: components.day -= components.weekday - [NSCalendar.currentCalendar firstWeekday]
1)ENG: dateWeekStart = 20 - (1-1) = 20.03.2016 - correct.
2)RUS: dateWeekStart = 20 - (1-2) = 21.03.2016 - incorrect
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.