{"id":19007650,"url":"https://github.com/razaghimahdi/compose-persian-date-picker","last_synced_at":"2025-08-21T07:32:11.521Z","repository":{"id":135576156,"uuid":"604650617","full_name":"razaghimahdi/Compose-Persian-Date-Picker","owner":"razaghimahdi","description":"A library which allows you to have Persian date picker dialog by Jetpack Compose.","archived":false,"fork":false,"pushed_at":"2024-11-06T16:27:15.000Z","size":3367,"stargazers_count":49,"open_issues_count":1,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-08T06:38:08.823Z","etag":null,"topics":["android","compose","date","date-picker","datepicker","dialog","jetpack","jetpack-android","jetpack-compose","persian","persian-calendar","persian-date-picker","persian-datepicker","persian-to-gregorian"],"latest_commit_sha":null,"homepage":"https://github.com/razaghimahdi/Compose-Persian-Date-Picker","language":"Kotlin","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/razaghimahdi.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":"2023-02-21T14:06:47.000Z","updated_at":"2024-11-19T08:12:34.000Z","dependencies_parsed_at":"2024-04-06T07:29:41.453Z","dependency_job_id":"5e91ad67-cde0-450c-87c6-b3ce7202ec78","html_url":"https://github.com/razaghimahdi/Compose-Persian-Date-Picker","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/razaghimahdi/Compose-Persian-Date-Picker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/razaghimahdi%2FCompose-Persian-Date-Picker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/razaghimahdi%2FCompose-Persian-Date-Picker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/razaghimahdi%2FCompose-Persian-Date-Picker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/razaghimahdi%2FCompose-Persian-Date-Picker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/razaghimahdi","download_url":"https://codeload.github.com/razaghimahdi/Compose-Persian-Date-Picker/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/razaghimahdi%2FCompose-Persian-Date-Picker/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271444181,"owners_count":24760738,"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-21T02:00:08.990Z","response_time":74,"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":["android","compose","date","date-picker","datepicker","dialog","jetpack","jetpack-android","jetpack-compose","persian","persian-calendar","persian-date-picker","persian-datepicker","persian-to-gregorian"],"created_at":"2024-11-08T18:38:59.587Z","updated_at":"2025-08-21T07:32:10.349Z","avatar_url":"https://github.com/razaghimahdi.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Compose Persian Date Picker\n\n`Compose Persian Date Picker` is a library that allows developers to add a Persian date picker to their Jetpack Compose apps. \nThe library provides a customizable dialog that lets users select a date using the Persian calendar,\nwith options for updating the selected date and other settings.\n\n## Give a Star! ⭐\nIf you like or are using this project to learn or start your solution, please give it a star. Thanks!\n\n\n[![](https://jitpack.io/v/razaghimahdi/Compose-Persian-Date-Picker.svg)](https://jitpack.io/#razaghimahdi/Compose-Persian-Date-Picker)\n\n\n| Bottom Sheet                               | Dialog                                     |\n|--------------------------------------------|--------------------------------------------|\n| \u003cimg src=\"screenshots/2.png\" width=\"300\"/\u003e | \u003cimg src=\"screenshots/1.png\" width=\"300\"/\u003e |\n\n\n## Quickstart\n\nHere's a quick example of how to use the library:\n\n1. Add the JitPack repository to your project-level build.gradle or settings.gradle file:\n\n```groovy\n\tallprojects {\n\t\trepositories {\n\t\t\tmaven { url 'https://jitpack.io' }\n\t\t}\n\t}\n```\n\n2. Add the library dependency to your app-level build.gradle file:\n\n```groovy\n    dependencies {\n            implementation 'com.github.razaghimahdi:Compose-Persian-Date-Picker:1.1.1'\n    } \n```\n\n3. Use the Persian Date Picker in your app:\n\n```kotlin\n\nval coroutine = rememberCoroutineScope()\nval rememberPersianDialogDatePicker = rememberDialogDatePicker()\nval rememberPersianBottomSheetDatePickerController = rememberDialogDatePicker()\nval showDialog = remember { mutableStateOf(false) }\nval bottomSheetState =  rememberModalBottomSheetState()\n\nif (showDialog.value) {\n    PersianLinearDatePickerDialog(\n        rememberPersianDatePicker,\n        Modifier.fillMaxWidth(),\n        onDismissRequest = { showDialog.value = false },\n        onDateChanged = { year, month, day -\u003e\n            // do something...\n        })\n}\n\nif (bottomSheetState.isVisible) {\n    DatePickerLinearModalBottomSheet(\n        modifier = Modifier\n            .fillMaxSize(),\n        sheetState = bottomSheetState,\n        controller = rememberPersianBottomSheetDatePickerController,\n        onDismissRequest = {\n            coroutine.launch {\n                bottomSheetState.hide()\n            }\n        }\n    )\n}\n\n\nButton(onClick = { showDialog.value = true }) {\n    Text(text = \"نمایش\")\n}\n\nButton(onClick = { coroutine.launch { bottomSheetState.show() } }) {\n    Text(text = \"نمایش باتم شت\")\n}\n```\n\n4. Customize the settings by calling methods on the rememberPersianDatePicker object:\n\n```Kotlin\n\nval rememberPersianDialogDatePicker = rememberDialogDatePicker()\nval rememberPersianBottomSheetDatePickerController = rememberDialogDatePicker()\n\n// 3 ways to update date\n\nLaunchedEffect(key1 = Unit) {\n\n    rememberPersianDialogDatePicker.updateDate(date = Date())\n    rememberPersianDialogDatePicker.updateDate(timestamp = Date().time)\n    rememberPersianDialogDatePicker.updateDate(\n        persianYear = 1403,\n        persianMonth = 7,\n        persianDay = 20\n    )\n\n    rememberPersianBottomSheetDatePickerController.updateDate(date = Date())\n    rememberPersianBottomSheetDatePickerController.updateDate(timestamp = Date().time)\n    rememberPersianBottomSheetDatePickerController.updateDate(\n        persianYear = 1403,\n        persianMonth = 7,\n        persianDay = 20\n    )\n}\n\n\nrememberPersianDialogDatePicker.updateMaxYear(1420)\nrememberPersianDialogDatePicker.updateMinYear(1395)\nrememberPersianDialogDatePicker.updateYearRange(10)\nrememberPersianDialogDatePicker.updateDisplayMonthNames(false)\n\n\nrememberPersianBottomSheetDatePickerController.updateMaxYear(1420)\nrememberPersianBottomSheetDatePickerController.updateMinYear(1395)\n\nPersianLinearDatePickerDialog(\n    rememberPersianDatePicker,\n    Modifier.fillMaxWidth(),\n    onDismissRequest = { showDialog.value = false },\n    onDateChanged = { year, month, day -\u003e\n        // do something...\n    }\n)\n\nDatePickerLinearModalBottomSheet(\n    modifier = Modifier\n        .fillMaxSize(),\n    sheetState = bottomSheetState,\n    controller = rememberPersianBottomSheetDatePickerController,\n    onDismissRequest = {\n        coroutine.launch {\n            bottomSheetState.hide()\n        }\n    }\n)\n\n```\n## Example\nFor a more detailed example, check out the [example app](https://github.com/razaghimahdi/Compose-Persian-Date-Picker/blob/master/app/src/main/java/com/razaghimahdi/composepersiandatepicker/MainActivity.kt) included in the repository.\n\n## Functions\nrememberPersianDatePicker has these functions that can be useful:\n| Function Name | Description |\n| --- | --- |\n| `getPersianYear()` | Returns the Persian year of the current date. |\n| `getPersianMonth()` | Returns the Persian month (1-12) of the current date. |\n| `getPersianDay()` | Returns the Persian day (1-31) of the current date. |\n| `getGregorianYear()` | Returns the Gregorian year of the current date. |\n| `getGregorianMonth()` | Returns the Gregorian month (1-12) of the current date. |\n| `getGregorianDay()` |Returns the Gregorian day (1-31) of the current date. |\n| `getDayOfWeek()` | Returns the day of the week (1-7) of the current date. |\n| `getPersianMonthName()` | Returns the name of the Persian month of the current date (e.g. \"اردیبهشت\"). |\n| `getPersianDayOfWeekName()` | Returns the name of the day of the week in Persian of the current date (e.g. \"شنبه\"). |\n| `getPersianFullDate()` | Returns the full Persian date of the current date in the format \"dayOfWeek day monthName year\" (e.g. \"پنج‌شنبه  10  شهریور  1401\"). |\n| `getGregorianDate()` | Returns the current date in the Gregorian calendar as a Date object. |\n| `getTimestamp()` | Returns the Unix timestamp of the current date in milliseconds. |\n\n## Screenshots\n[1.webm](https://github.com/razaghimahdi/Compose-Persian-Date-Picker/assets/61207818/d1626677-b373-4860-aad5-c6758ffb88d0)\n\n\n## Future Plan\nSoon there will be more date picker with Such as Range Date Picker, Multi Date Picker and...\n\n## Contributing\nContributions are welcome! If you find a bug or would like to create a new feature, please submit a pull request.\n\n## License\nThis library is licensed under the MIT License. See [LICENSE.txt](https://github.com/razaghimahdi/Compose-Persian-Date)\n\nDeveloped by Mahdi Razzaghi Ghaleh\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frazaghimahdi%2Fcompose-persian-date-picker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frazaghimahdi%2Fcompose-persian-date-picker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frazaghimahdi%2Fcompose-persian-date-picker/lists"}