{"id":18026568,"url":"https://github.com/hadilq/java-persian-calendar","last_synced_at":"2025-09-08T13:35:11.680Z","repository":{"id":72335134,"uuid":"75458478","full_name":"hadilq/java-persian-calendar","owner":"hadilq","description":null,"archived":false,"fork":false,"pushed_at":"2018-03-29T16:52:23.000Z","size":138,"stargazers_count":9,"open_issues_count":3,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-22T21:06:16.308Z","etag":null,"topics":["calendar","jalali","jalali-calendar","java","persian-calendar"],"latest_commit_sha":null,"homepage":null,"language":"Java","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/hadilq.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":"2016-12-03T07:12:18.000Z","updated_at":"2024-09-24T08:30:48.000Z","dependencies_parsed_at":null,"dependency_job_id":"35e714c3-99db-4bdd-af53-8a4e53342922","html_url":"https://github.com/hadilq/java-persian-calendar","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hadilq%2Fjava-persian-calendar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hadilq%2Fjava-persian-calendar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hadilq%2Fjava-persian-calendar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hadilq%2Fjava-persian-calendar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hadilq","download_url":"https://codeload.github.com/hadilq/java-persian-calendar/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245764660,"owners_count":20668456,"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":["calendar","jalali","jalali-calendar","java","persian-calendar"],"created_at":"2024-10-30T08:07:21.945Z","updated_at":"2025-03-27T01:31:17.254Z","avatar_url":"https://github.com/hadilq.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Download](https://api.bintray.com/packages/hadilq/Asparsa/Persian-Calendar/images/download.svg)](https://bintray.com/hadilq/Asparsa/Persian-Calendar/_latestVersion)\n[![Build Status](https://travis-ci.org/hadilq/java-persian-calendar.svg?branch=master)](https://travis-ci.org/hadilq/java-persian-calendar)\n\n# Java Persian Calendar\n\nThe main class of this project that you can copy to your project\nfreely is [PersianCalendar](https://github.com/hadilq/java-persian-calendar/blob/master/persian/src/main/java/ir/hadilq/PersianCalendar.java).\n\nThis calendar is unlimited as long as Kayyam rules and Java are correct.\nYou can see important functions in [here](https://github.com/hadilq/persian-calendar-important-functions) and [here](https://en.wikibooks.org/wiki/Persian_Calendar).\nAnd if you want to more proof of correctness of this class you can see the tests.\n \nHowever, this class is written in android project structure, you can simply use it in java projects.\n\nBTW, roll method of calendar is not supported, and I have no plan to support it.\nAlso, The maximum and minimum of fields are not carefully determined yet, but as you can see in tests,\nfrom year 3000 before hijra to 3000 after hijra is a valid interval for this calendar.\n\n## Add to dependencies\n\nThis single class library is added to [jcenter](https://bintray.com/hadilq/Asparsa/Persian-Calendar),\nso you can add it to your Android project as the following. Before gradle `3.0`\n\n```Gradle\ndependencies {\n    compile 'ir.hadilq:Persian-Calendar:1.1.3'\n}\n```\n\nAfter gradle `3.0`\n\n```Gradle\ndependencies {\n    implementation 'ir.hadilq:Persian-Calendar:1.1.3'\n}\n```\n\n## Usage\n\nYou can use it like this\n\n```Java\nPersianCalendar calendar = new PersianCalendar();\ncalendar.setTimeInMillis(time);\nint year = calendar.get(Calendar.YEAR);\nint month = calendar.get(Calendar.MONTH); // zero base just like standard Java SDK calendar\nint dayOfMonth = calendar.get(Calendar.DAY_OF_MONTH);\n\nint hourOfDay = calendar.get(Calendar.HOUR_OF_DAY);\nint minute = calendar.get(Calendar.MINUTE);\nint second = calendar.get(Calendar.SECOND);\n```\n\nOr you can use it like this\n\n```Java\nPersianCalendar calendar = new PersianCalendar(1395, 7, 23, 10, 56, 52);\nlong millis = calendar.getTimeInMillis()\n```\n\nAlso you can use add method like this\n\n```Java\ncalendar.add(Calendar.DATE, 1);\n```\n\nOr this\n\n```Java\ncalendar.add(Calendar.DATE, -1);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhadilq%2Fjava-persian-calendar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhadilq%2Fjava-persian-calendar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhadilq%2Fjava-persian-calendar/lists"}