GithubHelp home page GithubHelp logo

datekit's Introduction

DateKit

Add extra date functionality for objects that do not represent a timestamp.

Swift 4.2 Vapor 3 iOS 8 Carthage SPM GitHub

Build

Features

  • Date representations without timezone
  • Easy integration
  • Easily convert to and from framwork Date objects
  • Uses swift 4.2
  • Supports iOS 8 and up
  • Carthage support
  • SPM support

Usage

For the full documentation, click here: https://cuba.github.io/DateKit/

Import DateKit

Add the following to the top of any swift file using MapCodableKit

import DateKit 

Day (Local Date)

Day (also known as "Local Date") represents an object containing the year, month and day components in a calendar.

TODO: Examples

Time (Local Time)

Time (also known as "Local Time") object represents an object containing the hour, minute and second and nanosecond components in a calendar.

Since time is circular (starts at 0 and ends back at 0), time is not comparable as 3am may be larger than 9am. To compare time we need more information (such as the day).

TODO: Examples

DayTime (Local Date Time)

DayTime (also known as "Local Date Time") object represents an object containing the year, month and day, hour, minute, second and nanosecond components in a calendar. Its a convenience grouping of Day and Time object.

TODO: Examples

Duration

Duration represents time passed (or time that will pass) in weeks, days and hours, minutes, seconds and nanoseconds. It provides a way to represent date components that can be converted to a time interval without knowing the reference date.

Years, and months are not supported as they cannot be converted to a time interval without knowing a reference date and time zone. The reason for this is because the length of a month or year (in seconds) changes depending on the reference date. Leap years, for example, are shorter in seconds than non-leap years and a single month may be between 28 days (i.e. February) to 31 days (ex: December).

TODO: Examples

Installation

Package Manager

Package manager is a powerful packaging tool built into xcode. For the full documentation on how to use package manager, click here

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 DateKit into your Xcode project using Carthage, specify it in your Cartfile:

github "cuba/DateKit" ~> 1.0

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

Dependencies

Framework is the only dependency ๐Ÿ˜

Credits

DateKit is owned and maintained by Jacob Sikorski.

License

DateKit is released under the MIT license. See LICENSE for details.

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.