Skip to content

mcvnh/Amlich

Repository files navigation

Amlich

build status codecov SPM compatible Version License

Amlich is a Swift package that provides an interface to convert date from Solar to Lunar and vice-versa.

Usage

Put import Amlich on the top of your source code

Convert a solar date to lunar date

let solarDate = SolarDate(day: 1, month: 1, year: 2020)
let timeZone: Double = +7

print(Amlich.toLunar(of: solarDate, with: timeZone))
// or
print(solarDate.toLunar(with: timeZone))

Convert a lunar date to solar date

let lunarDate = LunarDate(day: 1, month: 1, year: 2020, isLeap: false)
let timeZone: Double = +7

print(Amlich.toSolar(of: lunarDate, with: timeZone))
// or
print(lunarDate.toSolar(with: timeZone))

Get the solar term of a solar date

let solarDate = SolarDate(day: 1, month: 1, year: 2020)
let hour = (hh: 10, mm: 20)
let timeZone: Double = +7

SolarTerm.of(solar: solarDate, in: hour, with: timeZone)

Installation

Cocoapods

Amlich is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'Amlich'

Swift Package Manager

Amlich is also available through Swift Package Manager. To install it, simply add the dependency to your Package.Swift file:

...
dependencies: [
    .package(url: "https://github.com/anhmv/Amlich.git", from: "1.1.2"),
],
targets: [
    .target( name: "[YourTarget]", dependencies: ["Amlich"]),
]
...

Help, feedback or suggestions?

  • Open a PR if you want to make some change to Releases.
  • Contact @mvanh91 on Twitter for discussions, news & announcements about Releases & other projects.

About

Amlich is a Swift package that provides an interface to convert date from Solar to Lunar and vice-versa.

Topics

Resources

License

Stars

Watchers

Forks