Amlich is a Swift package that provides an interface to convert date from Solar to Lunar and vice-versa.
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)
Amlich is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'Amlich'
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"]),
]
...
- Open a PR if you want to make some change to Releases.
- Contact @mvanh91 on Twitter for discussions, news & announcements about Releases & other projects.