Description
Calendar dates for Swift, built around DateComponents. Provides value objects for representing dates and times that are not directly bound to specific UTC offsets or timezones. This is useful when working with future events, as in the case of event and appointment scheduling apps.
CalendarDate alternatives and similar libraries
Based on the "Date" category.
Alternatively, view CalendarDate alternatives based on common mentions on social networks and blogs.
-
SwiftDate
๐ Toolkit to parse, validate, manipulate, compare and display dates, time & timezones in Swift. -
TrueTime.swift
NTP library for Swift and Objective-C. Get the true time impervious to device clock changes. -
TypedDate
Library for enhancing Swift's Date handling by enabling type-level customization of date components
CodeRabbit: AI Code Reviews for Developers

* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of CalendarDate or a related project?
README
CalendarDate
Calendar dates for Swift, built around DateComponents. Provides value objects for representing dates and times that are not directly bound to specific UTC offsets or timezones. This is useful when working with future events, as in the case of event and appointment scheduling apps.
CalendarDate provides the following value types:
CalendarTime
: Represents a wall time, such as "2:00PM".CalendarDate
: Represents a calendar date, such as a birthday.CalendarDateTime
: GroupsCalendarDate
andCalendarTime
to represent a date + time.
How to use it
You can initialize a CalendarDateTime
value directly and convert it to a Swift Date
when you need to display it to the user.
let meetingDate = CalendarDateTime(year: 2020, month: 4, day: 1, hour: 10, minute: 30)
let meetingTimezone = TimeZone(identifier: "America/New_York")
let date = meetingDate.asDate(timezone: meetingTimezone!)
let formatter = DateFormatter()
formatter.dateStyle = .long
formatter.timeStyle = .long
formatter.timeZone = TimeZone(identifier: "America/New_York") // Or .current
formatter.string(from: date) // -> "April 1, 2020 at 10:30:00 AM EDT"
Codable
The value types provided by this library all conform to Codable.
Value Type | Codable format |
---|---|
CalendarTime |
hh:mm:ss |
CalendarDate |
YYYY-MM-DD |
CalendarDateTime |
YYYY-MM-DDThh:mm:ss |