An open API service indexing awesome lists of open source software.

https://github.com/meniny/dawn

📅 Tiny library to make using `Date` easier. Written in Swift.
https://github.com/meniny/dawn

Last synced: 2 months ago
JSON representation

📅 Tiny library to make using `Date` easier. Written in Swift.

Awesome Lists containing this project

README

          

:name: Dawn
:author: Elias Abel
:author_esc: Elias%20Abel
:mail: admin@meniny.cn
:desc: a tiny library to make using `Date` easier. Written in Swift
:icon: {name}.png
:version: 1.0.0
:na: N/A
:ios: 8.0
:macos: 10.10
:watchos: 2.0
:tvos: 9.0
:linux: {na}
:xcode: 9.3
:swift: 4.1
:license: MIT
:sep: %20%7C%20
:platform: iOS{sep}macOS{sep}watchOS{sep}tvOS
// :toc: left
:toclevels: 6
:toc-title: TOC
:source-highlighter: highlightjs
// :source-highlighter: pygments
= Meet `{name}`
{author} <{mail}>
v{version}, 2018-06-01

[subs="attributes"]
++++


{name}



Author
EMail
MIT


Version
Platforms
Swift


Build Passing
Cocoapods
Carthage
SPM


++++

:toc:

== 🏵 Introduction

**{name}** is {desc}.

== 📋 Requirements

[%header]
|===
2+^m|Type 1+^m|Requirement

1.5+^.^|Platform ^|iOS ^|{ios}+
^|macOS ^|{macos}
^|tvOS ^|{tvos}
^|watchOS ^|{watchos}
^|Linux ^|{linux}

^|IDE ^|Xcode ^| {xcode}+
^|Language ^|Swift ^| {swift}+
|===

== 📲 Installation

=== CocoaPods

`{name}` is available on link:https://cocoapods.org[CocoaPods].

[source, ruby, subs="verbatim,attributes"]
----
use_frameworks!
pod '{name}'
----

=== Manually

Copy all files in the `{name}` directory into your project.

== 🛌 Dependency

{na}

== ❤️ Contribution

You are welcome to fork and submit pull requests.

== 🔖 License

`{name}` is open-sourced software, licensed under the link:./LICENSE.md[`{license}`] license.

== 🔫 Usage

[source, swift, subs="verbatim,attributes"]
----
import {name}

let now = Date()
print("now: \(now)")
print("now.isToday: \(now.isToday)")
print("now.isWeekend: \(now.isWeekend)")
print("now is: \(now.weekdayName.name)")

let nextDay = now.adding(days: 1)
print("nextDay: \(nextDay)")
print("nextDay.isTomorrow: \(nextDay.isTomorrow)")

let later = Today.compare(date: nextDay, ifLater: now)
print("nextDay is isLaterThan now: \(later)")

let todayInNextYear = Today.dateByAdding(1, of: .year, to: now)
print("todayInNextYear: \(String(describing: todayInNextYear))")
----