Skip to content

Releases: theevo/SexagenaryCycle1924

1.0.3

27 May 20:24
Compare
Choose a tag to compare

➕ New method that will return the string of the matching date range: ZodiacQuery.prettyPrintRange(dateStyle:)

1.0.2

27 May 01:19
Compare
Choose a tag to compare

✨ New initializer! Pass a Swift Date instead of a birthday String to ZodiacQuery. See README for usage.

1.0.1

21 Dec 16:36
Compare
Choose a tag to compare

No changes in API behavior. Just housekeeping items.

  • added License (spoiler: it's MIT)
  • moved Notes.MD out of Resources folder. It didn't belong there in the first place.

1.0.0

20 Dec 22:58
Compare
Choose a tag to compare

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
    }
}