|ReleasedLast Release||May 2017|
Maintained by Michał Nierebiński.
|Apps WeekApps This Week||1|
|Test WeekTests This week||2|
|LOCLines of Code||78|
Supported Swift version: Swift 3.0+
Supported platforms: iOS 9.0+, macOS 10.10+, tvOS 10.2+, watchOS 3.2, Ubuntu 14+
DateOfEaster is an extension for the
Date class, used for calcutation of Easter date, both western (used by Roman Catholic Church and many protestant and evangelical churches) and eastern (used by most of Eastern Orthodox Churches and Ancient Churches of the East).
You can also find eastern and western Pentecost dates with DateOfEaster.
Sometimes I need to find a certain Christian festive day’s date. A long ago I created a Ruby gem for this: when_easter. Now I thought to create something like this in Swift.
DateOfEaster is Swift Package Manager compatible.
You can also build DateOfEaster as a framework for iOS, macOS, tvOS or watchOS. After building it, drag the created .framework file into your Xcode project.
Find a western Easter date:
import DateOfEaster let easter2015 = Date.westernEasterDate(year: 2015)
Find an eastern Easter date:
import DateOfEaster let easter1983 = Date.easternEasterDate(year: 1983)
Find Pentecost dates:
import DateOfEaster let lastYearsEasternPentecost = Date.easternPentecostDate(year: 2016)
Date optional. Both eastern and western date calcutation are subject to certain limitations:
Otherwise both functions will return nil.
Both Easter date calcutation algorithms were taken from Wikipedia:
DateOfEaster includes a suite of tests for all functions of the library. They are tested with Xcode for iOS, macOS and tvOS. They were also run with Swift compiler under macOS and Ubuntu 14.
A playground is included in the project for you to learn how to use this library. Just build
DateOfEaster iOS target and play!
This project is distributed under a MIT license. See the LICENSE file for details.
DateOfEaster was created by Michał Nierebiński