Swiftpack.co - bestheme/lunar-swift as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by bestheme.
bestheme/lunar-swift 1.0.0-alpha.1
lunar是一款无第三方依赖的日历工具,支持公历(阳历)、农历(阴历、老黄历)、道历、佛历,支持星座、儒略日、干支、生肖、节气、节日、时间局、五行、法定节假日及调休等。
⭐️ 3
🕓 2 weeks ago
.package(url: "https://github.com/bestheme/lunar-swift.git", from: "1.0.0-alpha.1")

lunar License

lunar是一款无第三方依赖的日历工具,支持公历(阳历)、农历(阴历、老黄历)、道历、佛历,支持星座、儒略日、干支、生肖、节气、节日、时间局、五行、法定节假日及调休等。

示例

import SwiftLunar


//今天
//let date: Lunar = Lunar(fromDate: Date());

//指定阴历的某一天
let date: Lunar  = Lunar(fromYmd: 1986, month: 4, day: 21)
print(date.toFullString())
print(date.getSolar().toFullString())

输出结果:

一九八六年四月廿一 丙寅(虎)年 癸巳(蛇)月 癸酉(鸡)日 子(鼠)时 纳音[炉中火 长流水 剑锋金 桑柘木] 星期四 北方玄武 星宿[斗木獬](https://raw.github.com/bestheme/lunar-swift/main/吉) 彭祖百忌[癸不词讼理弱敌强 酉不会客醉坐颠狂] 喜神方位[巽](https://raw.github.com/bestheme/lunar-swift/main/东南) 阳贵神方位[巽](https://raw.github.com/bestheme/lunar-swift/main/东南) 阴贵神方位[震](https://raw.github.com/bestheme/lunar-swift/main/正东) 福神方位[兑](https://raw.github.com/bestheme/lunar-swift/main/正西) 财神方位[离](https://raw.github.com/bestheme/lunar-swift/main/正南) 冲[(丁卯)兔] 煞[东]
1986-05-29 00:00:00 星期四 双子座

感谢 6tail

GitHub

link
Stars: 3
Last commit: 2 days ago
jonrohan Something's broken? Yell at me @ptrpavlik. Praise and feedback (and money) is also welcome.

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics