{"id":2677,"url":"https://github.com/di2pra/D2PDatePicker","last_synced_at":"2025-08-03T00:32:20.551Z","repository":{"id":56907049,"uuid":"110371631","full_name":"di2pra/D2PDatePicker","owner":"di2pra","description":"Elegant and Easy-to-Use iOS Swift Date Picker","archived":false,"fork":false,"pushed_at":"2017-11-20T01:18:04.000Z","size":976,"stargazers_count":302,"open_issues_count":4,"forks_count":24,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-06-30T08:54:22.584Z","etag":null,"topics":["datepicker","elegant","ios","iphone","swift"],"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/di2pra.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-11-11T18:56:54.000Z","updated_at":"2025-04-26T07:49:08.000Z","dependencies_parsed_at":"2022-08-21T03:20:54.599Z","dependency_job_id":null,"html_url":"https://github.com/di2pra/D2PDatePicker","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/di2pra/D2PDatePicker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/di2pra%2FD2PDatePicker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/di2pra%2FD2PDatePicker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/di2pra%2FD2PDatePicker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/di2pra%2FD2PDatePicker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/di2pra","download_url":"https://codeload.github.com/di2pra/D2PDatePicker/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/di2pra%2FD2PDatePicker/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268315901,"owners_count":24231059,"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","status":"online","status_checked_at":"2025-08-01T02:00:08.611Z","response_time":67,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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","elegant","ios","iphone","swift"],"created_at":"2024-01-05T20:16:19.929Z","updated_at":"2025-08-03T00:32:20.018Z","avatar_url":"https://github.com/di2pra.png","language":"Swift","funding_links":[],"categories":["UI","OOM-Leaks-Crash"],"sub_categories":["PickerView","Other free courses","Picker"],"readme":"# D2PDatePicker\n\n[![CI Status](http://img.shields.io/travis/di2pra/D2PDatePicker.svg?style=flat)](https://travis-ci.org/di2pra/D2PDatePicker)\n[![Version](https://img.shields.io/cocoapods/v/D2PDatePicker.svg?style=flat)](http://cocoapods.org/pods/D2PDatePicker)\n[![License](https://img.shields.io/cocoapods/l/D2PDatePicker.svg?style=flat)](http://cocoapods.org/pods/D2PDatePicker)\n[![Platform](https://img.shields.io/cocoapods/p/D2PDatePicker.svg?style=flat)](http://cocoapods.org/pods/D2PDatePicker)\n\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003cth\u003e\u003cimg alt=\"Screenshot 1\" src=\"https://github.com/di2pra/D2PDatePicker/blob/master/image/screen_1.png\" width=\"300\"\u003e\u003c/th\u003e\n    \u003cth\u003e\u003cimg alt=\"Screenshot 1\" src=\"https://github.com/di2pra/D2PDatePicker/blob/master/image/demo.gif\" width=\"300\"\u003e\u003c/th\u003e\n    \u003cth\u003e\u003cimg alt=\"Screenshot 2\" src=\"https://github.com/di2pra/D2PDatePicker/blob/master/image/screen_2.png\" width=\"300\"\u003e\u003c/th\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n\n## Example\n\nTo run the example project, clone the repo, and run `pod install` from the Example directory first.\n\n### Example Code: Programmatical Initialization\n```Swift\n\nimport D2PDatePicker\n\nclass ViewController: UIViewController {\n    \n    var datePickerView: D2PDatePicker!\n\n    override func viewDidLoad() {\n        super.viewDidLoad()\n        // Do any additional setup after loading the view, typically from a nib.\n        \n        // Init DatePickerView\n        datePickerView = D2PDatePicker(frame: .zero, date: Date())\n        datePickerView.translatesAutoresizingMaskIntoConstraints = false\n        \n        // Set the Delegate\n        datePickerView.delegate = self\n        self.view.addSubview(datePickerView)\n        \n        self.view.addConstraints([\n            NSLayoutConstraint(item: datePickerView, attribute: .height, relatedBy: .equal, toItem: nil, attribute: .notAnAttribute, multiplier: 1, constant: 250),\n            NSLayoutConstraint(item: datePickerView, attribute: .width, relatedBy: .equal, toItem: nil, attribute: .notAnAttribute, multiplier: 1, constant: 200),\n            NSLayoutConstraint(item: datePickerView, attribute: .centerX, relatedBy: .equal, toItem: self.view, attribute: .centerX, multiplier: 1, constant: 0),\n            NSLayoutConstraint(item: datePickerView, attribute: .centerY, relatedBy: .equal, toItem: self.view, attribute: .centerY, multiplier: 1, constant: 0)])\n\n    }\n\n    override func didReceiveMemoryWarning() {\n        super.didReceiveMemoryWarning()\n        // Dispose of any resources that can be recreated.\n    }\n\n\n}\n\nextension ViewController: D2PDatePickerDelegate {\n    \n    func didChange(toDate date: Date) {\n        print(date)\n    }\n    \n}\n```\n## Documentation\nAll of the methods and properties available for **D2PDatePicker** are documented below.\n\n### Changing the Main Color\n##### The `mainColor` Property\nUse the mainColor property of `D2PDatePicker` to change the color.\nExample usage:\n```Swift\nself.datePickerView.mainColor = .red\n```\n\n### Delegate\n**D2PDatePicker** uses a delegate to receive date change events. The delegate object must conform to the `D2PDatePickerDelete` protocol, which is composed of the method:\n\n- `didChange(toDate date: Date)`\nTells the delegate that the selected the date get updated.\n\n## Requirements\n\nNo Requirements\n\n## Installation\n\nD2PDatePicker is available through [CocoaPods](http://cocoapods.org). To install\nit, simply add the following line to your Podfile:\n\n```ruby\npod 'D2PDatePicker'\n```\n\n## Author\n\n[Di2pra](https://twitter.com/di2pra) [LinkedIn](https://www.linkedin.com/in/di2pra/)\n\n## Credits\n\nCredit to http://felicegattuso.com/projects/datedropper/ for the inspiration\n\n## License\n\nD2PDatePicker is available under the MIT license. See the LICENSE file for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdi2pra%2FD2PDatePicker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdi2pra%2FD2PDatePicker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdi2pra%2FD2PDatePicker/lists"}