A Swift library that simplifies working with Date, DateComponents, and TimeInterval using a clean, modular API.
Datez is a Swift library that provides a clean, modular API for working with dates, calendars, and time intervals. It simplifies common tasks like accessing date components, performing date arithmetic, and converting between time units, while avoiding hardcoded calculations that can lead to errors.
Swift developers building iOS, macOS, watchOS, or tvOS apps who need to handle date and time operations with clarity and precision.
Developers choose Datez for its expressive Swift-native API, explicit calendar support, and avoidance of error-prone hardcoded date math, making date manipulation more intuitive and less stressful.
📆 Breeze through Date, DateComponents, and TimeInterval with Swift!
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Provides direct access to date components for specific calendars like Gregorian and IslamicCivil through properties like `gregorian.components.day`, eliminating assumptions about the underlying calendar as shown in the README examples.
Offers Swift-native syntax for adding components (e.g., `+ 1.day`) and accessing relative dates (e.g., `beginningOfDay`), reducing boilerplate code with clear examples in the README.
Built around two core structs (DateView and CalendarComponents) that promote composable operations, emphasized in the README as providing 'only one way to achieve something' for consistency.
Eliminates error-prone hardcoded math like `minutes = seconds * 60` by leveraging Apple's Calendar APIs, ensuring correctness in date arithmetic as highlighted in the motivation section.
The duration conversion features, such as `totalMonths`, are explicitly marked as 'not ideal at all for precise calculation' in the README, making them unreliable for accurate time interval computations.
Datez is restricted to Apple ecosystems (iOS, macOS, watchOS, tvOS) due to its dependency on Foundation, excluding use in cross-platform or server-side Swift projects.
Version 5.0.0 requires Swift 6.0, which may hinder adoption in projects using older Swift versions or needing to maintain backward compatibility.