Coder Social home page Coder Social logo

jinjorge / swiftdate Goto Github PK

View Code? Open in Web Editor NEW

This project forked from malcommac/swiftdate

1.0 3.0 0.0 24.86 MB

The best way to manage Dates and Timezones in Swift

Home Page: http://malcommac.github.io/SwiftDate

License: MIT License

Swift 98.85% Ruby 0.31% Objective-C 0.83%

swiftdate's Introduction

SwiftDate

Carthage compatible CI Status Version License Platform

We really ♥ Swift and we think that dates and timezones management should be painless: this is the reason we made SwiftDate, probability the best way to manage date and time in Swift.

Choose SwiftDate for your next project, or migrate over your existing projects—you'll be happy you did!

★★ Star our github repository to help us! ★★

Main features

That's an highlight of the main features you can found in SwiftDate:

  • Simple math operation with dates! Example: aDate + 2.weeks + 1.hour or (1.year - 2.hours + 16.minutes).fromNow()
  • Easy conversions to and from timezone, locale and calendar. Use helper class DateInRegion and perform conversions with components and operations!
  • Compare dates with math operators <,>,==,<=,>=. For example you can do aDate1 >= aDate2 or aDate1.isIn(anotherDate,.day)
  • Easily work with time components. E.g. aDateInRegion.day or hour, minutes etc. expressed in your favourite timezone!
  • Easy and optimized way to get and transform a date from and to strings: supports both colloquial (human readable) and fixed formats (ISO8601, AltRSS, RSS, Extended, .NET and custom string as per Unicode standard)
  • Express time interval in other time units; for example 120.seconds.in(.minutes) // 2 minutes
  • Many shortcuts to get intervals, work with time units, intervals and common date operations (isYesterday,isTomorrow,isBefore()...)
  • ... many many other shiny things!

How to get started

Documentation

Code is documented for Xcode, so you can use built in documentation panel to learn more about the library.

You can also generate latest documentation using Jazzy; install Jazzy via gem install jazzy then, from terminal, move to /SwiftDate folder and type jazzy -c jazzy.yaml. Documentation will be generated in docs folder.

Communication

Current Release

Last release is: 4.0.7 Download here released on Mon, Oct 24, 2016.

A complete list of changes for each release is available in CHANGELOG file.

Help Us!

Currently we need translations for SwiftDate.bundle. Help us with a pull request!

Currently SwiftDate supports:

  • English (since 4.0.0)
  • Italian (since 4.0.0)
  • German (made by to hackolein, since 4.0.3)
  • Dutch (made by hout, since 4.0.0)
  • French (made by pierrolivier, since 4.0.5)
  • Indonesian (made by suprie, since 4.0.5)
  • Simplified Chinese (made by codingrhythm, since 4.0.5)
  • Traditional Chinese (made by rynecheow, since 4.0.7)

Make a pull request and add your language!

Installation

SwiftDate supports multiple methods for installing the library in a project.

Installation with CocoaPods

CocoaPods is a dependency manager for Objective-C, which automates and simplifies the process of using 3rd-party libraries like SwiftDate in your projects.You can install it with the following command:

$ gem install cocoapods

CocoaPods 1.0.1+ is required to build SwiftDate 4+ (along with Swift 3 and Xcode 8).

Podfile

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

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'

target 'TargetName' do
use_frameworks!
pod 'SwiftDate', '~> 4.0'
end

Then, run the following command:

$ pod install

Installation with Carthage

Carthage is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.

You can install Carthage with Homebrew using the following command:

$ brew update
$ brew install carthage

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

github "malcommac/SwiftDate" ~> 4.0

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

Requirements

Actually current official version is 4.0.7 and it's compatible with:

  • Swift 3.0+
  • iOS 8 or later
  • macOS 10.10 or later
  • watchOS 2.0 or later
  • tvOS 9.0 or later
  • ...and virtually any platform which is compatible with Swift 3 and implements the Swift Foundation Library

Are you searching for an old (unsupported) SwiftDate version? Check out:

Credits & License

SwiftDate is owned and maintained by Daniele Margutti along with main contribution of Jeroen Houtzager.

As open source creation any help is welcome!

The code of this library is licensed under MIT License; you can use it in commercial products without any limitation.

The only requirement is to add a line in your Credits/About section with the text below:

Date and Time Management is provided by SwiftDate - http://www.swift-date.com
Created by Daniele Margutti and licensed under MIT License.

Your App and SwiftDate

If you want we are interested in making a list of all projects which uses this library. Feel free to open an Issue on GitHub so with the name and links of your project; we'll add it to this site.

swiftdate's People

Contributors

akuraru avatar bitomule avatar cgoldsby avatar codingrhythm avatar ehuynh avatar fhisa avatar fjohn666 avatar hout avatar jairobjunior avatar jakecraige avatar jondwillis avatar knao124 avatar lammertw avatar malcommac avatar marknorgren avatar maximusmccann avatar mrichtsfeld avatar muukii avatar nebulafox avatar onekiloparsec avatar pedrovieira avatar pettomartino avatar raven avatar rynecheow avatar simonrice avatar stormxx avatar suprie avatar tasanobu avatar toriaezunama avatar ya-s-u avatar

Stargazers

 avatar

Watchers

 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.