Git Product home page Git Product logo

cupertinoyankee's Introduction

A Cupertino Yankee in Scott Forstall's Court

An NSDate Category With Locale-Aware Calculations for Beginning & End of Day, Week, Month, and Year

This library is no longer maintained. In iOS 7.0+ and macOS 10.9+, use Calendar.range(of:in:for:) instead.

Usage

NSLog(@"Current Time: %@", date);
NSLog(@"Beginning of Day:%@", [date beginningOfDay]);
NSLog(@"End of Day:%@", [date endOfDay]);
NSLog(@"Beginning of Week:%@", [date beginningOfWeek]);
NSLog(@"End of Week:%@", [date endOfWeek]);
NSLog(@"Beginning of Month:%@", [date beginningOfMonth]);
NSLog(@"End of Month:%@", [date endOfMonth]);
NSLog(@"Beginning of Year:%@", [date beginningOfYear]);
NSLog(@"End of Year:%@", [date endOfYear]);

Result (Note the Time Zone and Daylight Savings Offsets)

Current Time: 2013-10-19 13:29:26 +0000
Beginning of Day: 2013-10-18 22:00:00 +0000
End of Day: 2013-10-19 21:59:59 +0000
Beginning of Week: 2013-10-12 22:00:00 +0000
End of Week: 2013-10-19 21:59:59 +0000
Beginning of Month: 2013-09-30 22:00:00 +0000
End of Month: 2013-10-31 22:59:59 +0000
Beginning of Year: 2012-12-31 23:00:00 +0000
End of Year: 2013-12-31 22:59:59 +0000

License

MIT

Contact

Mattt (@mattt)

cupertinoyankee's People

Contributors

ksm avatar mattt avatar zachwaugh 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  avatar  avatar  avatar  avatar  avatar

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.