{"id":24213627,"url":"https://github.com/destrmz/datepickerrange","last_synced_at":"2025-03-03T17:14:26.179Z","repository":{"id":269302808,"uuid":"904345142","full_name":"DestrMZ/DatePickerRange","owner":"DestrMZ","description":"Custom date picker with the ability to select both past and future dates.","archived":false,"fork":false,"pushed_at":"2025-01-11T19:29:45.000Z","size":173,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-03T17:14:21.732Z","etag":null,"topics":["appdevelopment","datepicker","datepickerrange","iosdevelopment","swift","swiftui","swiftuicomponents"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DestrMZ.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2024-12-16T17:53:51.000Z","updated_at":"2025-01-11T19:19:39.000Z","dependencies_parsed_at":"2025-01-16T00:17:22.412Z","dependency_job_id":null,"html_url":"https://github.com/DestrMZ/DatePickerRange","commit_stats":null,"previous_names":["destrmz/datepickerrange"],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DestrMZ%2FDatePickerRange","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DestrMZ%2FDatePickerRange/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DestrMZ%2FDatePickerRange/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DestrMZ%2FDatePickerRange/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DestrMZ","download_url":"https://codeload.github.com/DestrMZ/DatePickerRange/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241705911,"owners_count":20006397,"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":["appdevelopment","datepicker","datepickerrange","iosdevelopment","swift","swiftui","swiftuicomponents"],"created_at":"2025-01-14T03:17:19.248Z","updated_at":"2025-03-03T17:14:26.160Z","avatar_url":"https://github.com/DestrMZ.png","language":"Swift","readme":"# DatePickerRange 📅\n\nA beautiful and fully customizable date picker for selecting date ranges, with the ability to choose both past and future periods. This SwiftUI component is designed for seamless integration into any iOS 14.0+ app, offering a smooth and intuitive user experience when selecting start and end dates.\n\n## Features\n\n- **Customizable Date Range**: Easily select dates from both past and future periods through a user-friendly interface.\n- **Auto-Scroll to Current Date**: The picker automatically scrolls to the current date when loaded.\n- **Human-Readable Date Formatting**: Display selected dates in a clean and intuitive format (e.g., \"4 December\").\n- **Responsive \u0026 Lightweight**: Built with SwiftUI, optimized for iOS 14+ with smooth animations and minimal memory usage.\n- **Clear UI**: Clearly displays the selected start and end dates in the header for easy reference.\n\n## 🌅 Dark/Light mode\n![image](https://github.com/user-attachments/assets/e3614218-e7cd-4ce7-944c-08a6aa03d854)\n\n## Installation\n\n### Swift Package Manager (SPM)\n\nTo integrate `DatePickerRange` into your project using Swift Package Manager, follow these steps:\n\n1. Open your Xcode project.\n2. Navigate to **File** -\u003e **Add Packages**.\n3. Paste the following repository URL: [https://github.com/DestrMZ/DatePickerRange.git](https://github.com/DestrMZ/DatePickerRange.git).\n4. Select the desired version and add it to your project.\n\n## Usage\n\nImport the package into your SwiftUI view:\n\n```swift \nimport DatePickerRange\n```\n\nTo start working with CalendarManager, you need to create an instance of it with the required parameters:\n```swift \n@StateObject var calendarManager = CalendarManager(\n    minimumDate: Date(), // Set the minimum selectable date\n    maximumDate: Date().addingTimeInterval(60 * 60 * 24 * 365), // Set the maximum selectable date (1 year from today)\n    isFutureSelectionEnabled: false // Allow future dates? Set to true if needed\n)\n```\n\n## Track Selected Dates\nUsing CalendarManager, you can get and update selected dates, for example, in your view.\nExample:\n```swift \n@State var startDate: Date? = nil\n@State var endDate: Date? = nil\n```\nYou can subscribe to changes to these dates using .onChange(of:) to automatically update the values ​​in your view:\n```swift \nDPViewController(calendarManager: calendarManager)\n    .onChange(of: calendarManager.startDate) { newStartDate in\n        startDate = newStartDate\n    }\n    .onChange(of: calendarManager.endDate) { newEndDate in\n        endDate = newEndDate\n    }\n```\n\n## Full example\nHere’s a full example using the package with bindings to your view:\n```swift \nimport SwiftUI\nimport DatePickerRange\n\nstruct SelectDateView: View {\n    \n    @StateObject var calendarManager = CalendarManager(\n        minimumDate: Date(), \n        maximumDate: Date().addingTimeInterval(60*60*24*365), \n        isFutureSelectionEnabled: false\n    )\n    \n    @State var startDate: Date? = nil\n    @State var endDate: Date? = nil\n\n    var body: some View {\n        Group {\n            DPViewController(calendarManager: calendarManager)\n                .onChange(of: calendarManager.startDate) { newStartDate in\n                    startDate = newStartDate\n                }\n                .onChange(of: calendarManager.endDate) { newEndDate in\n                    endDate = newEndDate\n                }\n        }\n    }\n}\n\n#Preview {\n    SelectDateView()\n}\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdestrmz%2Fdatepickerrange","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdestrmz%2Fdatepickerrange","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdestrmz%2Fdatepickerrange/lists"}