loom & weft
Made for Swift.

Unreleased APIs from PR #2. Not in 0.2.1. Stable 0.2.1 reference.

LOOM Unreleased (PR #2) / PLOTTING AND CALENDARS

CalendarDay

A date-only Gregorian day with no implicit clock, timezone, or daylight-saving conversion.

Standard inherited Swift protocol operations such as synthesized equality and OptionSet set operations are not repeated. The public declarations below are extracted from the exact source revision listed in the coverage manifest.

Members on this page

Feature guides and release status

CalendarDay

Structure
struct CalendarDay

Conforms to: Swift.Comparable, Swift.Equatable, Swift.Hashable, Swift.Sendable, Swift.SendableMetatype.

A date-only Gregorian day with no implicit clock, timezone, or daylight-saving conversion.

Source · CalendarDate.swift:37

year

Instance Property
let year: Int

A public field of this type. Its value type and mutability are shown in the declaration.

Source · CalendarDate.swift:38

month

Instance Property
let month: Int

A public field of this type. Its value type and mutability are shown in the declaration.

Source · CalendarDate.swift:39

day

Instance Property
let day: Int

A public field of this type. Its value type and mutability are shown in the declaration.

Source · CalendarDate.swift:40

init(year:month:day:)

Initializer Throws
init(year: Int, month: Int, day: Int) throws

Creates a value with the supplied arguments. Default arguments are shown in the declaration.

Parameters (3)
year
Argument type and any default are shown in the declaration; see the behavior notes above.
month
Argument type and any default are shown in the declaration; see the behavior notes above.
day
Argument type and any default are shown in the declaration; see the behavior notes above.
Source · CalendarDate.swift:42

weekday

Instance Property
var weekday: CalendarWeekday { get }

A public field of this type. Its value type and mutability are shown in the declaration.

Source · CalendarDate.swift:54

<(_:_:)

Operator
static func < (lhs: CalendarDay, rhs: CalendarDay) -> Bool

Orders validated Gregorian dates chronologically by year, month, and day.

Parameters (2)
lhs
Argument type and any default are shown in the declaration; see the behavior notes above.
rhs
Argument type and any default are shown in the declaration; see the behavior notes above.

Returns Bool.

Source · CalendarDate.swift:56

adding(days:)

Instance Method
func adding(days: Int) -> CalendarDay?

Adds whole calendar days; returns nil outside years 1...9999 or on integer overflow.

Parameters (1)
days
Argument type and any default are shown in the declaration; see the behavior notes above.

Returns CalendarDay?.

Source · CalendarDate.swift:61