{"id":26648157,"url":"https://github.com/borax12/MaterialDateRangePicker","last_synced_at":"2025-03-25T00:01:52.034Z","repository":{"id":57717948,"uuid":"42445994","full_name":"heysupratim/material-daterange-picker","owner":"heysupratim","description":"A material Date Range Picker based on wdullaers MaterialDateTimePicker","archived":false,"fork":false,"pushed_at":"2020-05-13T09:50:52.000Z","size":868,"stargazers_count":1326,"open_issues_count":14,"forks_count":268,"subscribers_count":42,"default_branch":"master","last_synced_at":"2024-07-30T14:17:40.912Z","etag":null,"topics":["datepicker","datetimepicker","material","picker","range-selection","timepicker"],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/heysupratim.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}},"created_at":"2015-09-14T12:00:47.000Z","updated_at":"2024-07-01T13:21:40.000Z","dependencies_parsed_at":"2022-08-24T07:20:45.907Z","dependency_job_id":null,"html_url":"https://github.com/heysupratim/material-daterange-picker","commit_stats":null,"previous_names":["heysupratim/materialdaterangepicker","borax12/materialdaterangepicker"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heysupratim%2Fmaterial-daterange-picker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heysupratim%2Fmaterial-daterange-picker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heysupratim%2Fmaterial-daterange-picker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heysupratim%2Fmaterial-daterange-picker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/heysupratim","download_url":"https://codeload.github.com/heysupratim/material-daterange-picker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245372377,"owners_count":20604491,"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","datetimepicker","material","picker","range-selection","timepicker"],"created_at":"2025-03-25T00:01:28.431Z","updated_at":"2025-03-25T00:01:52.007Z","avatar_url":"https://github.com/heysupratim.png","language":"Java","readme":"[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-MaterialDateRangePicker-brightgreen.svg?style=flat)](http://android-arsenal.com/details/1/2501)\n\n[ ![Download](https://api.bintray.com/packages/borax12/maven/material-datetime-rangepicker/images/download.svg) ](https://bintray.com/borax12/maven/material-datetime-rangepicker/_latestVersion)\n\n[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.borax12.materialdaterangepicker/library/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.borax12.materialdaterangepicker/library)\n\n\nMaterial Date and Time Picker with Range Selection\n======================================================\n\n\nCredits to the original amazing material date picker library by wdullaer - https://github.com/wdullaer/MaterialDateTimePicker\n\n## Adding to your project\n\nAdd the jcenter repository information in your build.gradle file like this\n```java\n\nrepositories {\n  jcenter()\n}\n\n\ndependencies {\n  implementation 'com.borax12.materialdaterangepicker:library:2.0'\n}\n\n```\nBeginning Version 2.0 now also available on Maven Central\n\n\n## Date Selection\n\n![FROM](/screenshots/2.png?raw=true)\n![TO](/screenshots/1.png?raw=true)\n\n## Time Selection\n\n![FROM](/screenshots/3.png?raw=true)\n![TO](/screenshots/4.png?raw=true)\n\nSupport for Android 4.0 and up.\n\nFrom the original library documentation -\n\nYou may also add the library as an Android Library to your project. All the library files live in ```library```.\n\nUsing the  Pickers\n--------------------------------\n\n1. Implement an `OnDateSetListener` or `OnTimeSetListener`\n2. Create a ``DatePickerDialog` using the supplied factory\n\n### Implement an `OnDateSetListener`\nIn order to receive the date  set in the picker, you will need to implement the `OnDateSetListener` interfaces. Typically this will be the `Activity` or `Fragment` that creates the Pickers.\n\nor\n### Implement an `OnTimeSetListener`\nIn order to receive the time set in the picker, you will need to implement the `OnTimeSetListener` interfaces. Typically this will be the `Activity` or `Fragment` that creates the Pickers.\n\n```java\n\n//new onDateSet\n@Override\npublic void onDateSet(DatePickerDialog view, int year, int monthOfYear, int dayOfMonth,int yearEnd, int monthOfYearEnd, int dayOfMonthEnd) {\n\n}\n\n@Override\npublic void onTimeSet(DatePickerDialog view, int year, int monthOfYear, int dayOfMonth,int yearEnd, int monthOfYearEnd, int dayOfMonthEnd) {\n        String hourString = hourOfDay \u003c 10 ? \"0\"+hourOfDay : \"\"+hourOfDay;\n        String minuteString = minute \u003c 10 ? \"0\"+minute : \"\"+minute;\n        String hourStringEnd = hourOfDayEnd \u003c 10 ? \"0\"+hourOfDayEnd : \"\"+hourOfDayEnd;\n        String minuteStringEnd = minuteEnd \u003c 10 ? \"0\"+minuteEnd : \"\"+minuteEnd;\n        String time = \"You picked the following time: From - \"+hourString+\"h\"+minuteString+\" To - \"+hourStringEnd+\"h\"+minuteStringEnd;\n\n        timeTextView.setText(time);\n\n}\n```\n\n### Create a DatePickerDialog` using the supplied factory\nYou will need to create a new instance of `DatePickerDialog` using the static `newInstance()` method, supplying proper default values and a callback. Once the dialogs are configured, you can call `show()`.\n\n```java\nCalendar now = Calendar.getInstance();\nDatePickerDialog dpd = DatePickerDialog.newInstance(\n  MainActivity.this,\n  now.get(Calendar.YEAR),\n  now.get(Calendar.MONTH),\n  now.get(Calendar.DAY_OF_MONTH)\n);\ndpd.show(getFragmentManager(), \"Datepickerdialog\");\n```\n\n### Create a TimePickerDialog` using the supplied factory\nYou will need to create a new instance of `TimePickerDialog` using the static `newInstance()` method, supplying proper default values and a callback. Once the dialogs are configured, you can call `show()`.\n```java\nCalendar now = Calendar.getInstance();\nTimePickerDialog tpd = TimePickerDialog.newInstance(\n                        MainActivity.this,\n                        now.get(Calendar.HOUR_OF_DAY),\n                        now.get(Calendar.MINUTE),\n                        false\n                );\ntpd.show(getFragmentManager(), \"Timepickerdialog\");\n```\n\nFor other documentation regarding theming , handling orientation changes , and callbacks - check out the original documentation - https://github.com/wdullaer/MaterialDateTimePicker","funding_links":[],"categories":["Index `(light-weight pages)`","Index","日历时间","Libs"],"sub_categories":["\u003cA NAME=\"Widget\"\u003e\u003c/A\u003eWidget"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fborax12%2FMaterialDateRangePicker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fborax12%2FMaterialDateRangePicker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fborax12%2FMaterialDateRangePicker/lists"}