Amlich 1.1.2

Amlich 1.1.2

Anh Mac 维护。



Amlich 1.1.2

  • Anh Mac

Amlich

build status codecov SPM compatible Version License

Amlich 是一个 Swift 包,它提供了一个从阳历到阴历以及反之的接口。

使用

import Amlich 放在源代码顶部

将阳历日期转换为阴历日期

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))

将阴历日期转换为阳历日期

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))

获取阳历日期对应的节气

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)

安装

  • Package.swift 文件的 dependencies 中添加 .package(url: "https://github.com/anhmv/Amlich.git", from: "1.0.0")
  • 使用 $ swift package update 更新您的包。

帮助、反馈或建议?