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.
- Host: GitHub
- URL: https://github.com/meniny/dawn
- Owner: Meniny
- License: mit
- Created: 2018-06-01T12:44:13.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-06-01T12:59:03.000Z (about 8 years ago)
- Last Synced: 2025-02-20T20:02:39.193Z (over 1 year ago)
- Language: Swift
- Homepage:
- Size: 880 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.adoc
- License: LICENSE.md
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"]
++++
++++
: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))")
----