<commit_before>![SwiftDate](https://raw.githubusercontent.com/malcommac/SwiftDate/master/assets/logo.png)

##Easy NSDate Management in Swift 2

### Author
<NAME>  
*web*: [www.danielemargutti.com](http://www.danielemargutti.com)  
*twitter*: [@danielemargutti](http://www.twitter.com/danielemargutti)  
*mail*: me [at] danielemargutti dot com  
*original post*: [blog](http://danielemargutti.com/how-to-manage-nsdate-easily-in-swift-with-swiftdate/)  
  
This library is licensed under MIT license and it's compatible with Swift 2.0+.

###Features
- [x] Math operations with dates ```(ie. myDate+2.week+1.hour)```
- [x] Easy compare using ```<,>,==,<=,>=``` operators
- [x] Easy individual date component set/get
- [x] Easy creation with common formats or custom formats
- [x] Powerful .toString methods with support for relative dates (ie. "2hours"...)
- [x] Many shortcuts to get intervals and common dates (yesterday,tomorrow...)
- [x] *... check out documentation below!*

###Requirements
* iOS 8.0+ / Mac OS X 10.10+
* Xcode 6.3
* Swift 2.0

## Communication
- If you **found a bug**, open an issue.
- If you **have a feature request**, open an issue.
- If you **want to contribute**, submit a pull request.

## ToDo
- Complete All Unit Tests

##Version History
##1.2 (Oct 4, 2015)
- Fixed several issues with `ISO8601 formatter` when parsing dates ending with Z
- Deprecated several comparing date methods (`minutes/hours/days/month/years Before/After` a date and replaced with a single `difference` method)
- Fixed an issue with non 24 hours days
- Added `-` (minus) operator between dates
- Added support for `carthage`
- Added optional params in `set/add` methods of dates
- Removed extra `ago/from now' string literals from `toRelativeString` method.

##1.1
- This version is fully compatible with Swift 2.0+
- Minor fixes around

### CocoaPods

[CocoaPods](http://cocoapods.org) is a dependency manager for Cocoa projects.
CocoaPods 0.36 adds supports for Swift and embedded frameworks. You can install it with the following command:

```bash
$ gem install cocoapods
```

To integrate SwiftDate into your Xcode project using CocoaPods, specify it in your `Podfile`:

```ruby
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!

pod 'SwiftDate'
```

Then, run the following command:

```bash
$ pod install
```

##API Documentation

###Introduction
Date Management in UIKit/AppKit is a pain, you know? Probably it's not the better API bought by Apple for Mac or iOS. If you have worked in ObjC you know, there are lots of classes to manipulate date objects easily.
I've made SwiftDates because I've started working with Swift development and I need something which save to me with Date during the development.<commit_msg>- Adding Carthage installation steps;<commit_after>![SwiftDate](https://raw.githubusercontent.com/malcommac/SwiftDate/master/assets/logo.png)

##Easy NSDate Management in Swift 2

### Author
<NAME>  
*web*: [www.danielemargutti.com](http://www.danielemargutti.com)  
*twitter*: [@danielemargutti](http://www.twitter.com/danielemargutti)  
*mail*: me [at] danielemargutti dot com  
*original post*: [blog](http://danielemargutti.com/how-to-manage-nsdate-easily-in-swift-with-swiftdate/)  
  
This library is licensed under MIT license and it's compatible with Swift 2.0+.

###Features
- [x] Math operations with dates ```(ie. myDate+2.week+1.hour)```
- [x] Easy compare using ```<,>,==,<=,>=``` operators
- [x] Easy individual date component set/get
- [x] Easy creation with common formats or custom formats
- [x] Powerful .toString methods with support for relative dates (ie. "2hours"...)
- [x] Many shortcuts to get intervals and common dates (yesterday,tomorrow...)
- [x] *... check out documentation below!*

###Requirements
* iOS 8.0+ / Mac OS X 10.10+
* Xcode 6.3
* Swift 2.0

## Communication
- If you **found a bug**, open an issue.
- If you **have a feature request**, open an issue.
- If you **want to contribute**, submit a pull request.

## ToDo
- Complete All Unit Tests

##Version History
##1.2 (Oct 4, 2015)
- Fixed several issues with `ISO8601 formatter` when parsing dates ending with Z
- Deprecated several comparing date methods (`minutes/hours/days/month/years Before/After` a date and replaced with a single `difference` method)
- Fixed an issue with non 24 hours days
- Added `-` (minus) operator between dates
- Added support for `carthage`
- Added optional params in `set/add` methods of dates
- Removed extra `ago/from now' string literals from `toRelativeString` method.

##1.1
- This version is fully compatible with Swift 2.0+
- Minor fixes around

### CocoaPods

[CocoaPods](http://cocoapods.org) is a dependency manager for Cocoa projects.
CocoaPods 0.36 adds supports for Swift and embedded frameworks. You can install it with the following command:

```bash
$ gem install cocoapods
```

To integrate SwiftDate into your Xcode project using CocoaPods, specify it in your `Podfile`:

```ruby
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!

pod 'SwiftDate'
```

Then, run the following command:

```bash
$ pod install
```

### Carthage

[Carthage](https://github.com/Carthage/Carthage) is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.

You can install Carthage with [Homebrew](http://brew.sh/) using the following command:

```bash
$ brew update
$ brew install carthage
```

To integrate SwiftDate into your Xcode project using Carthage, specify it in your `Cartfile`:

```ogdl
github "malcommac/SwiftDate" ~> 1.2
```

Run `carthage` to build the framework and drag the built `SwiftDate.framework` into your Xcode project.

##API Documentation

###Introduction
Date Management in UIKit/AppKit is a pain, you know? Probably it's not the better API bought by Apple for Mac or iOS. If you have worked in ObjC you know, there are lots of classes to manipulate date objects easily.
I've made SwiftDates because I've started working with Swift development and I need something which save to me with Date during the development.
{'fraction_non_alphanumeric': 0.11520209458353788, 'fraction_numerical': 0.012763868433971527, 'mean_word_length': 4.432888888888889, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 10, 'https://': 5, 'lorem ipsum': 0, 'www.': 6, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5841217', 'n_tokens_mistral': 1993, 'n_tokens_neox': 1832, 'n_words': 747}