{"id":32118985,"url":"https://github.com/alimo/jalaali-deno","last_synced_at":"2026-05-17T06:36:24.332Z","repository":{"id":57675609,"uuid":"448013858","full_name":"alimo/jalaali-deno","owner":"alimo","description":"JavaScript functions for converting Jalaali and Gregorian calendar systems to each other","archived":false,"fork":false,"pushed_at":"2022-01-16T07:29:58.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-11-20T22:07:15.810Z","etag":null,"topics":["deno","gregorian","jalaali"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/alimo.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":"2022-01-14T15:24:13.000Z","updated_at":"2022-08-28T15:54:58.000Z","dependencies_parsed_at":"2022-09-15T05:40:59.048Z","dependency_job_id":null,"html_url":"https://github.com/alimo/jalaali-deno","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/alimo/jalaali-deno","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alimo%2Fjalaali-deno","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alimo%2Fjalaali-deno/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alimo%2Fjalaali-deno/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alimo%2Fjalaali-deno/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alimo","download_url":"https://codeload.github.com/alimo/jalaali-deno/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alimo%2Fjalaali-deno/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33129290,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-17T06:27:06.342Z","status":"ssl_error","status_checked_at":"2026-05-17T06:26:59.432Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["deno","gregorian","jalaali"],"created_at":"2025-10-20T17:50:11.454Z","updated_at":"2026-05-17T06:36:24.320Z","avatar_url":"https://github.com/alimo.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Jalaali Calendar Utilities for Deno\n\nA few utility functions for converting Jalaali (Jalali, Persian, Khayyami, Khorshidi, Shamsi) and Gregorian calendar systems to each other.\n\n\u003e This repo is a Typescript implementation of https://github.com/jalaali/jalaali-js and is suited to be used with [Deno](https://deno.land/).\n\n## Usage\n\n```js\nimport * as jalaali from 'https://deno.land/x/jalaali@0.0.1/mod.ts';\n```\n\n## API\n\n### toJalaali(gy, gm, gd)\n\nConverts a Gregorian date to Jalaali.\n\n```js\njalaali.toJalaali(2016, 4, 11) // { jy: 1395, jm: 1, jd: 23 }\n```\n\n### toJalaali(date)\n\nConverts a JavaScript Date object to Jalaali.\n\n```js\njalaali.toJalaali(new Date(2016, 3, 11)) // { jy: 1395, jm: 1, jd: 23 }\n```\n\n### toGregorian(jy, jm, jd)\n\nConverts a Jalaali date to Gregorian.\n\n```js\njalaali.toGregorian(1395, 1, 23) // { gy: 2016, gm: 4, gd: 11 }\n```\n\n### isValidJalaaliDate(jy, jm, jd)\n\nChecks whether a Jalaali date is valid or not.\n\n```js\njalaali.isValidJalaaliDate(1394, 12, 30) // false\njalaali.isValidJalaaliDate(1395, 12, 30) // true\n```\n\n### isLeapJalaaliYear(jy)\n\nIs this a leap year or not?\n\n```js\njalaali.isLeapJalaaliYear(1394) // false\njalaali.isLeapJalaaliYear(1395) // true\n```\n\n### jalaaliMonthLength(jy, jm)\n\nThe number of days in a given month in a Jalaali year.\n\n```js\njalaali.jalaaliMonthLength(1394, 12) // 29\njalaali.jalaaliMonthLength(1395, 12) // 30\n```\n\n### jalCal(jy)\n\nThis function determines if the Jalaali (Persian) year is a leap (366-day long) or is the common year (365 days), and finds the day in March (Gregorian calendar) of the first day of the Jalaali year (jy).\n\n```js\njalaali.jalCal(1390) // { leap: 3, gy: 2011, march: 21 }\njalaali.jalCal(1391) // { leap: 0, gy: 2012, march: 20 }\njalaali.jalCal(1392) // { leap: 1, gy: 2013, march: 21 }\njalaali.jalCal(1393) // { leap: 2, gy: 2014, march: 21 }\njalaali.jalCal(1394) // { leap: 3, gy: 2015, march: 21 }\njalaali.jalCal(1395) // { leap: 0, gy: 2016, march: 20 }\n```\n\n### j2d(jy, jm, jd)\n\nConverts a date of the Jalaali calendar to the Julian Day number.\n\n```js\njalaali.j2d(1395, 1, 23) // 2457490\n```\n\n### d2j(jdn)\n\nConverts the Julian Day number to a date in the Jalaali calendar.\n\n```js\njalaali.d2j(2457490) // { jy: 1395, jm: 1, jd: 23 }\n```\n\n### g2d(gy, gm, gd)\n\nCalculates the Julian Day number from Gregorian or Julian calendar dates. This integer number corresponds to the noon of the date (i.e. 12 hours of Universal Time). The procedure was tested to be good since 1 March, -100100 (of both calendars) up to a few million years into the future.\n\n```js\njalaali.g2d(2016, 4, 11) // 2457490\n```\n\n### d2g(jdn)\n\nCalculates Gregorian and Julian calendar dates from the Julian Day number (jdn) for the period since jdn=-34839655 (i.e. the year -100100 of both calendars) to some millions of years ahead of the present.\n\n```js\njalaali.d2g(2457490) // { gy: 2016, gm: 4, gd: 11 }\n```\n\n### jalaaliToDateObject(jy, jm, jd)\n\nConvert Jalaali calendar date to javascript Date object by giving Jalaali year, month, and day.\n\n```js\njalaali.jalaaliToDateObject(1400, 4, 30) // new Date(2021, 6, 21)\n```\n\n### jalaaliWeek(jy, jm, jd)\n\nReturns Saturday and Friday day of the current week (week starts on Saturday)\n\n```js\njalaali.jalaaliWeek(1400, 4, 30) // { saturday: { jy: 1400, jm: 4, jd: 26 }, friday: { jy: 1400, jm: 5, jd: 1 } }\n```\n\n## Run Tests\n\n```sh\ndeno --unstable test\n```\n\n## About\n\nJalali calendar is a solar calendar that was used in Persia, variants of which today are still in use in Iran as well as Afghanistan. [Read more on Wikipedia](http://en.wikipedia.org/wiki/Jalali_calendar) or see [Calendar Converter](http://www.fourmilab.ch/documents/calendar/).\n\nCalendar conversion is based on the [algorithm provided by Kazimierz M. Borkowski](http://www.astro.uni.torun.pl/~kb/Papers/EMP/PersianC-EMP.htm) and has a very good performance.\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falimo%2Fjalaali-deno","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falimo%2Fjalaali-deno","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falimo%2Fjalaali-deno/lists"}