Swiftpack.co - Package - koher/swift-ymd

SwiftYMD

SwiftYMD helps to calculate dates in the forms of YMD and YM.

let ymd1 = YMD(1988, 12, 3)!   // Dec. 3, 1988
let ymd2 = ymd1 + .days(11331) // Dec. 12, 2012
print(ymd2 - ymd1)             // 11331
print(ymd2.dayOfWeek)          // Thursday

for ymd in YMD(1988, 12, 3)! ... YMD(2019, 12, 12)! {
    // ...
}

License

MIT

Github

link
Stars: 4

Dependencies

Used By

Total: 0

Releases

Fix calendars - 2020-08-18 05:13:42

  • Fix all calendars used internally to be Gregorian

Initializers for type conversions - 2020-07-03 10:53:55

  • YM(_ year: Int, _ month: Int)
  • YMD(_ year: Int, _ month: Int, _ day: Int)
  • YM(_ description: String)
  • YMD(_ description: String)
  • YM(_: Date, timeZone: TimeZone)
  • YMD(_: Date, timeZone: TimeZone)
  • Date(_: YM, timeZone: TimeZone)
  • Date(_: YMD, timeZone: TimeZone)

Codable Year and Month - 2020-06-03 03:43:26

Year and Month conform to Codable.

YM and YMD do not conform to Codable because they have various encoded formats and it is preferable that users can specify the formats.

Fix typo - 2020-06-02 15:20:15

dayOfWeak to dayOfWeek

- 2020-06-02 14:57:44