Skip to content

1.0.0

Compare
Choose a tag to compare
@theevo theevo released this 20 Dec 22:58
· 38 commits to main since this release

It's ready!

Purpose

This is a Swift Package that will:

  1. For Swift devs: Service requests specifying a date as a parameter, responding with the Chinese zodiac's Associated element and Associated animal
  2. For non-Swift devs: Publish a programmer-friendly JSON file containing all the data mentioned below

Current status

Complete!

What? Sexa-wha?

A Sexagenary Cycle is a sixty-year cycle, historically used for recording time in China and the rest of the East Asian cultural sphere. The most popular use for this is to determine your Chinese zodiac sign according to your year of birth.

Swift Usage

Get your animal sign

Pass your birthday as a String (format: MM-DD-YYYY) as a paramter to the ZodiacQuery initializer.

import SexagenaryCycle1924

let query = try! ZodiacQuery(birthday: "11-26-1978")
printy(query.animal) // ".Horse"

Other properties

In addition to your Chinese animal sign, there is additional information unique to your year of birth such as Element, Heavenly Stem, and Earthly Branch. Here's the struct:

public struct SexagenaryAnimal: Encodable {
    public var name: Name
    public var element: String
    public var heavenlyStem: String
    public var earthlyBranch: String
    public var dates: [DateRange]
    
    public struct DateRange: Encodable {
        public var start: Date
        public var end: Date
    }
}