ChronoPicker is a highly customizable and lightweight SwiftUI date picker component designed for seamless integration into your iOS and macOS applications. With support for optionals, custom disabled dates, theming, and localization, ChronoPicker provides the flexibility you need to create a tailored user experience.

- 🛠 Custom Disabled Dates: Disable specific dates or ranges based on your business logic, perfect for blackout periods, holidays, or availability constraints.
- 🎨 Customizability: Fully customize the appearance, including colors, fonts, and styles, to seamlessly match your app's design.
- 🌍 Localization: Built-in support for multiple languages, adapting automatically to the user's locale and calendar settings.
Add ChronoPicker to your project using Swift Package Manager (SPM):
- Open your Xcode project.
- Go to File > Add Packages.
- Enter the repository URL:
https://github.com/yourusername/ChronoPicker
- Select the version or branch you'd like to use.
If you are using a Package.swift, add ChronoPicker
as following:
let package = Package(
name: "Your Project Name",
dependencies: [
.package(url: "https://github.com/Kn3cht/ChronoPicker/releases", from: "<version>") // Checkout https://github.com/Kn3cht/ChronoPicker/releases
],
...
)
ChronoPicker is designed with a usage pattern inspired by SwiftUI's standard DatePicker. However, unlike the standard DatePicker, ChronoPicker allows the selected date to be nil. This makes it ideal for scenarios where selecting a date is optional, such as forms or filters.
import SwiftUI
import ChronoPicker
struct ContentView: View {
@State private var selectedDate: Date? = Date()
var body: some View {
ChronoPicker($selectedDate)
.padding()
}
}
ChronoDatePicker has been updated to support date range selection, allowing users to choose a start and end date in addition to single-date selection. This enhancement makes it ideal for use cases like booking systems, scheduling, and other applications requiring date ranges.
import SwiftUI
import ChronoPicker
struct RangePickerExample: View {
@State private var selectedDateRange: DateRange = DateRange(startDate: Date(), endDate: Calendar.current.date(byAdding: .day, value: 4, to: Date()))
var body: some View {
VStack {
ChronoDatePicker($selectedDateRange)
Text(selectedDateRange.description)
}
}
}

ChronoPicker's dateDisabled
callback function offers unparalleled flexibility compared to traditional range-based disabling. While ranges are sufficient for basic use cases, the callback function allows you to define complex, dynamic rules for disabling dates.

This approach ensures maximum flexibility, making ChronoPicker suitable for any scheduling or availability-related scenario.
// Callback: Disable weekends
ChronoPicker(
$selectedDate,
dateDisabled: { date in
Calendar.current.isDateInWeekend(date)
}
)
// Range: Disable all dates after today
ChronoPicker(
$selectedDate,
in: ..<Date()
)
ChronoPicker provides full flexibility for rendering dates by allowing you to override the default date view with your custom design. This feature is perfect for scenarios where you want to display additional information (e.g., events, availability) or apply unique styles to specific dates.
ChronoDatePicker(
$selectedDate,
customDateView: { date, selected, adjacent in
// Your custom view
})
Checkout further examples here.
- iOS 15.0
- macOS 16.0