HarptosCalendar

public final class HarptosCalendar

The HarptosCalendar can be used to create HarptosTime objects

  • Return a time for a given year, month & day

    Declaration

    Swift

    public static func getTimeFor(year: Int, month: Int, day: Int, hour: Int = 0, minute: Int = 0, second: Int = 0) -> HarptosTime

    Parameters

    year

    The year, it’s recommended to limit the range from -700 DR to 1600 DR

    month

    A value between 1 and 12

    day

    A value between 1 and 30

  • Return a time for a given year and festival

    Declaration

    Swift

    public static func getTimeFor(year: Int, festival: HarptosFestival, hour: Int = 0, minute: Int = 0, second: Int = 0) -> HarptosTime

    Parameters

    year

    The year, it’s recommended to limit the range from -700 DR to 1600 DR

    festival

    A festival

  • Return a time object for a given epoch, where 0 is equal to 0 Dale Reckoning

    Declaration

    Swift

    public static func getTimeFor(epoch: Int) -> HarptosTime

    Parameters

    epoch

    The epoch

Retrieve human-readable names for years, months & festivals

  • Return the name for the year, will be nil if the year is not in range (-700 … 1600)

    Declaration

    Swift

    public static func getNameFor(year: Int) -> String?

    Parameters

    year

    The year to return the name for

  • Return the names for a month; the first name is the most common name, but can be followed by alternate names

    Declaration

    Swift

    public static func getNamesFor(month: Int) -> [String]

    Parameters

    month

    The month to return the name for

  • Return the name for a festival

    Declaration

    Swift

    public static func getNameFor(festival: HarptosFestival) -> String

    Parameters

    festival

    The festival to return the name for