A customizable date picker for watchOS and SwiftUI.

Overview

Watch Date Picker

A customizable date picker for watchOS and SwiftUI.

Installation

.package(url: "https://github.com/freyaariel/watch-date-picker.git", branch: "main")
import WatchDatePicker

Overview

The DatePicker view displays a button with a title and the selected value. When pressed, it presents a sheet with user interfaces for selecting date and time.

Date & Time Mode

DatePicker("Date & Time", selection: $value)

Date Mode

DatePicker("Date", selection: $value, mode: .date, maximumDate: Date())

Time Mode

DatePicker("Time", selection: $value, mode: .time, twentyFourHours: true)

Outside of Lists

Both DatePickerView and TimePickerView can be used indepedently of DatePicker.

Date Picker View

DatePickerView(selection: $value)

DatePickerView(selection: $value)
  .environment(\.locale, Locale(identifier: "fr"))

Time Picker View

TimePickerView(selection: $value)

TimePickerView(
  selection: $value,
  selectionIndicatorRadius: 7,
  selectionIndicatorColor: .mint,
  focusColor: .purple,
  amPMHighlightColor: .yellow,
  markSize: CGSize(width: 5.5, height: 3),
  markFill: AnyShapeStyle(Color.white.opacity(0.75)),
  emphasizedMarkSize: CGSize(width: 2, height: 7),
  emphasizedMarkFill: AnyShapeStyle(Color.pink)
)

ℹ️ Note:

The API exposed by WatchDatePicker is different from that of SwiftUI’s built-in date picker. When sharing code between multiple platforms, #if os(watchOS), target memberships, or namespaces can be used to disambiguate.

Topics

Setting Date Picker Mode

var mode: DatePicker.Mode

Mode that determines the appearance of a date picker. Default is .dateAndTime.

Customizing Appearance

var confirmationColor: Color? 

The color for the date & time confirmation button. Default is .green. When mode is not .dateAndTime, this value is ignored.

var confirmationTitleKey: LocalizedStringKey?

The radius of the date & time confirmation button. Default is “Continue” if mode is .dateAndTime, or “Done” if mode is .date. When mode is .time or nil, this value is ignored.

var selectionIndicatorRadius: CGFloat?

The radius of the time selection indicators. Default is 2.0. When mode is .date, this value is ignored.

var selectionIndicatorColor: Color?

The color for the time selection indicators. Default is .accentColor. When mode is .date, this value is ignored.

var focusColor: Color?

The color for the focus outline of time fields. Default is .green.

You might also like...
Building a better date/time library for Swift

Time Time is a Swift package that makes dealing with calendar values a natural and straight-forward process. Working with calendars can be extremely c

Swift Date Formatter

Swift Date Formatter Date Formatter - Sample code on how to use Date Formatter in swift language Author: Denow Cleetus For OSSE Assignment 4 Group 24

NasaApod - iOS, Swift, MVVM, Consuming NASA Astronomy Picture of the Day API for any selected date

NasaApod iOS, Swift, MVVM, Unit Tests Consuming NASA Astronomy Picture of the Da

Swifty Date & Time API inspired from Java 8 DateTime API.

AnyDate Swifty Date & Time API inspired from Java 8 DateTime API. Background I think that date & time API should be easy and accurate. Previous dates,

🎗 Super lightweight ISO8601 Date Formatter in Swift
🎗 Super lightweight ISO8601 Date Formatter in Swift

ISO8601 ❤️ Support my apps ❤️ Push Hero - pure Swift native macOS application to test push notifications PastePal - Pasteboard, note and shortcut mana

Custom Time Picker ViewController with Selection of start and end times in Swift 🔶
Custom Time Picker ViewController with Selection of start and end times in Swift 🔶

LFTimePicker Custom Time Picker ViewController with Selection of start and end times in Swift 🔶 . Based on Adey Salyard's design @ Dribbble One to tw

This Control is a beautiful time-of-day picker heavily inspired by the iOS 10
This Control is a beautiful time-of-day picker heavily inspired by the iOS 10 "Bedtime" timer.

#10Clock Dark and Mysterious 🕶 Light Colors 🌻 Usage The control itsself is TenClock. Add that to your view hierarchy, and constrain it to be square

Better time picker for iOS.

TimePicker Better TimePicker for iOS Requirements Swift 5.0 iOS 10.0+ Xcode 10.2+ Installation The easiest way is through CocoaPods. Simply add the de

Create your own faces for watchOS.  Customize the watch hands, layout, colors, and images.  Edit faces on your phone and switch them on the watch.
Create your own faces for watchOS. Customize the watch hands, layout, colors, and images. Edit faces on your phone and switch them on the watch.

AppleWatchFaces Design your own watch faces for the apple watch. They are not real watch faces, but a watchOS app running on the watch that tells you

Releases(0.1.0)
Owner
Freya Ariel
Hubbing the Git since 2009.
Freya Ariel
Date Formatter Pool - is a small utility that creates and stores your Date Formatter for simpler reuse

Date Formatter Pool Date Formatter Pool - is a small utility that creates and stores your Date Formatter for simpler reuse Installation is available i

Aleksei Artemev 13 Sep 6, 2022
A basic countdown app that allows the user to create, edit, and delete events. Each event contains a live countdown timer to a specified date and time.

Event Countdown App (iOS) Created by Lucas Ausberger About This Project Created: January 4, 2021 Last Updated: January 8, 2021 Current Verison: 1.1.1

Lucas Ausberger 1 Jan 8, 2022
📆 Breeze through Date, DateComponents, and TimeInterval with Swift!

Datez ?? Breeze through Date, DateComponents, and TimeInterval Highlights Two Custom Structs Only (value types FTW!): DateView: An Date associated wit

Kitz 263 Dec 7, 2022
NVDate is an extension of NSDate class (Swift4), created to make date and time manipulation easier.

NVDate is an extension of NSDate class (Swift4), created to make date and time manipulation easier. NVDate is testable and robust, we wrote intensive test to make sure everything is safe.

Noval Agung Prayogo 177 Oct 5, 2022
Date and time manager for iOS/OSX written in Swift

Tempo was designed to work both in OSX and in iOS (7.0+). Work with the time or dates can be cumbersome, iOS development. Tempo allows you to deal easly with date and time. Basics manipulations are already implemented in Tempo.

Remi ROBERT 153 Jun 3, 2021
Swifty Date & Time API inspired from Java 8 DateTime API.

AnyDate Swifty Date & Time API inspired from Java 8 DateTime API. Background I think that date & time API should be easy and accurate. Previous dates,

Jungwon An 182 Dec 1, 2022
DateHelper - A high performant Swift Date Extension for creating, converting, comparing, or modifying dates.

DateHelper A high performant Swift Date Extension for creating, converting, comparing, or modifying dates. Capabilities Creating a Date from a String

Melvin Rivera 1.4k Jan 2, 2023
Datify 🕛 Easypeasy date functions.

Datify ?? Easypeasy date functions.

Hemang 44 Dec 6, 2022
Intuitive date handling in Swift

Timepiece Intuitive date handling in Swift Features ?? Intuitive: Timepiece provides a set of helpers to make date handling easier. ?? Correct: Using

Naoto Kaneko 2.6k Dec 22, 2022
Elegant NTP date library in Swift

Kronos is an NTP client library written in Swift. It supports sub-seconds precision and provides a stable monotonic clock that won't be affected by ch

Mobile Native Foundation 575 Dec 23, 2022