Latest 2.0.0
Homepage https://github.com/eddiekaiger/SwiftyDate
License MIT
Platforms ios 8.0
Authors

SwiftyDate allows you to easily create relative NSDates in Swift.

It extends the Swift number types to allow you to create expressions like this:

let pastDate = 12.days.ago()
let futureDate = 7.weeks.fromNow()
let beforeDate = 5.minutes.before(anotherDate)
let afterDate = 15.hours.after(anotherDate)

Includes extensions for NSTimeInterval, Double, Int, Float, CGFloat, and NSNumber.

Time interval types:

  • seconds
  • minutes
  • hours
  • days
  • weeks

Functions to generate dates:

  • fromNow()
  • ago()
  • after(date: NSDate)
  • before(date: NSDate)

Installation

CocoaPods

pod 'SwiftyDate'

Usage

import SwiftyDate


Original idea by my friend Joe.

Latest podspec

{
    "name": "SwiftyDate",
    "version": "2.0.0",
    "summary": "The easiest way to generate relative dates in Swift.",
    "description": "SwiftyDate allows you to easily create relative Dates in Swift using a readable syntax.",
    "homepage": "https://github.com/eddiekaiger/SwiftyDate",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Eddie Kaiger": "[email protected]"
    },
    "source": {
        "git": "https://github.com/eddiekaiger/SwiftyDate.git",
        "tag": "v2.0.0"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "SwiftyDate/*.swift"
}

Pin It on Pinterest

Share This