Code Monkey home page Code Monkey logo

nsdate-calendar's People

Contributors

artembartle avatar belkevich avatar dentelezhkin avatar jmhobbs avatar kevnm67 avatar lingtorp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

nsdate-calendar's Issues

dateWeekEnd error

myDate.dateWeekEnd returns date less then date of called object myDate

Bless you!

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!

Setting time with dateBySetting... clobbers dates

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: Days in plural but other singular?

Why plural for days but not for the others ?

  • (NSDate *)dateByAddingDays:(NSInteger)days;

- (NSDate *)dateByAddingMonth:(NSInteger)month;

  • (NSDate *)dateByAddingYear:(NSInteger)year;
  • (NSDate *)dateByAddingHour:(NSInteger)hour;
  • (NSDate *)dateByAddingMinute:(NSInteger)minute;
  • (NSDate *)dateByAddingSecond:(NSInteger)second;

dateWeekStart

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.