{"id":26099318,"url":"https://github.com/chris-swift-dev/tvdatepicker","last_synced_at":"2025-04-12T13:42:25.641Z","repository":{"id":63907257,"uuid":"323147010","full_name":"chris-swift-dev/TVDatePicker","owner":"chris-swift-dev","description":"The missing SwiftUI DatePicker view for tvOS","archived":false,"fork":false,"pushed_at":"2023-05-26T16:01:41.000Z","size":7161,"stargazers_count":2,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"dev","last_synced_at":"2025-03-22T03:03:29.568Z","etag":null,"topics":["datepicker","swift","swiftui","tvos"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chris-swift-dev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-12-20T19:17:22.000Z","updated_at":"2023-12-22T11:53:28.000Z","dependencies_parsed_at":"2025-02-25T20:51:43.593Z","dependency_job_id":"174e5fd1-1476-4794-9369-252ed027dc38","html_url":"https://github.com/chris-swift-dev/TVDatePicker","commit_stats":null,"previous_names":["chris-swift-dev/tvdatepicker","crelies/tvdatepicker"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chris-swift-dev%2FTVDatePicker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chris-swift-dev%2FTVDatePicker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chris-swift-dev%2FTVDatePicker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chris-swift-dev%2FTVDatePicker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chris-swift-dev","download_url":"https://codeload.github.com/chris-swift-dev/TVDatePicker/tar.gz/refs/heads/dev","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248574592,"owners_count":21127042,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["datepicker","swift","swiftui","tvos"],"created_at":"2025-03-09T16:37:04.287Z","updated_at":"2025-04-12T13:42:25.620Z","avatar_url":"https://github.com/chris-swift-dev.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 📅 TVDatePicker\n\nA `SwiftUI` `DatePicker` view for `tvOS`\n\n[![Swift 5.3](https://img.shields.io/badge/swift-5.3-green.svg?longCache=true\u0026style=flat-square)](https://developer.apple.com/swift)\n[![Platforms](https://img.shields.io/badge/platform-tvOS-lightgrey.svg?longCache=true\u0026style=flat-square)](https://www.apple.com)\n[![Current Version](https://img.shields.io/github/v/tag/crelies/TVDatePicker?longCache=true\u0026style=flat-square)](https://github.com/crelies/TVDatePicker)\n[![License](https://img.shields.io/badge/license-MIT-lightgrey.svg?longCache=true\u0026style=flat-square)](https://en.wikipedia.org/wiki/MIT_License)\n\n## ❤️ Motivation\n\nCurrently there is no native `SwiftUI` `DatePicker` for `tvOS`. That's why I created this Swift package to fill the hole 😊\nThe `API` mimics the one of the native `SwiftUI` `DatePicker` available for `iOS`, `macOS` and `macCatalyst`. \n\n## ℹ️ Installation\n\nJust add this Swift package as a dependency to your `Package.swift`:\n\n```swift\n.package(url: \"https://github.com/crelies/TVDatePicker.git\", from: \"0.1.0\")\n```\n\n## 🧭 Usage\n\nThe following code snippet shows how to use the `DatePicker` `view` in your `tvOS` application:\n\n```swift\nTVDatePicker(\n    _ titleKey: LocalizedStringKey,\n    selection: Binding\u003cDate\u003e,\n    minimumDate: Date,\n    displayedComponents: Components = .all,\n    calendar: Calendar = .current,\n    dateFormatter: DateFormatter = DateFormatters.defaultFormatter,\n    label: () -\u003e Label\n) // Available when Label conforms to View.\n```\n\nAt first the view appears as a button with a horizontal stack containing the specified `label`, a `Text` view representing the current `selection` date string and a `disclosure indicator` `Image` view. If you press the button a sheet with the actual date picker view appears. The following screenshot is an example:\n\n\u003cimg src=\"https://github.com/crelies/TVDatePicker/blob/dev/example.png\" alt=\"Screenshot of a date picker view usage example\" width=\"800\" height=\"450\"\u003e\u003c/img\u003e\n\n## 📖 Implementation\n\nThe `DatePicker` view is implemented by using multiple `Picker`s with the `SegmentedPickerStyle` inside a `List` / `VStack`.\nEach `Picker` represents a date component like `year`, `month` or `date`. Due to issues with the focus engine the implementation slightly differs for the supported tvOS versions `13.0`, `14.0` and \u003e `14.0`. But I think that you can ignore this detail in most cases.\n\n## 🔒 Limitations\n\n- ⚠️ The `DatePicker` was only tested with the `Gregorian calendar`.\n- The `year` component displays only `10` years at a time (`selected year +/- 5 years` with respect to the year of the specified `minimum date`).\n- ⚠️ Currently only the `year` component respects the `minimum date`. On the contrary `all months of a year` and `all days of a month` are visible at all time.\n- Currently the `hourAndMinute` component always displays all `24 hours` of a day.\n- The `hourAndMinute` component supports only steps by five for the `minute`. \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchris-swift-dev%2Ftvdatepicker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchris-swift-dev%2Ftvdatepicker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchris-swift-dev%2Ftvdatepicker/lists"}