/TaklDateTools

Swift 3 conversion of CupertinoYankee pod and Swift 3 conversion of select methods from DateTools pod

Primary LanguageSwiftMIT LicenseMIT

TaklDateTools

A set of Date extensions, written in Swift 🔶. Inspired by CupertinoYankee and DateTools

Swift Version Build Status License CocoaPods Compatible
Platform

Features

  • beginningOfDay/Month, endOfDay/Month
  • day/weekDay/month/year Int numbers
  • isEarlier/isLater/isEqualTo other date
  • add and subtract minutes/hours/days/months
  • minutes/daysFrom other date

Requirements

  • iOS 8.0+
  • Xcode 8

Installation

CocoaPods

You can use CocoaPods to install TaklDateTools by adding it to your Podfile:

platform :ios, '8.0'
use_frameworks!
pod 'TaklDateTools', :git => 'https://github.com/TaklApp/TaklDateTools.git'

To get the full benefits import TaklDateTools wherever you import UIKit

import UIKit
import TaklDateTools

Manually

  1. Download and drop Takl+Date.swift in your project.
  2. Congratulations!

Usage example

var date = Date(timeIntervalSince1970: 0)
var date2 = Date(timeIntervalSince1970: 120)

date2.minutesFrom(date: date) //2

Contribute

We would love for you to contribute to Takl+Date.swift, check the LICENSE file for more info.

Meta

Takl – @takl_app

Distributed under the MIT license. See LICENSE for more information.

https://github.com/TaklApp/