{"id":18617552,"url":"https://github.com/arashm/jdate","last_synced_at":"2025-04-09T15:02:03.060Z","repository":{"id":19316692,"uuid":"22554796","full_name":"arashm/JDate","owner":"arashm","description":"A Jalali to Gregorian converter in Javascript with support of formatting output","archived":false,"fork":false,"pushed_at":"2025-03-15T03:31:08.000Z","size":8917,"stargazers_count":90,"open_issues_count":8,"forks_count":27,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-02T08:36:22.173Z","etag":null,"topics":["calendar","gregorian-converter","jalali","jdate","solar"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/arashm.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":"2014-08-02T19:04:23.000Z","updated_at":"2025-03-15T03:19:57.000Z","dependencies_parsed_at":"2024-06-18T18:14:13.357Z","dependency_job_id":"5a99a7d6-112e-4f3c-95d6-7930eebfdf87","html_url":"https://github.com/arashm/JDate","commit_stats":{"total_commits":75,"total_committers":3,"mean_commits":25.0,"dds":"0.053333333333333344","last_synced_commit":"601874ed68ebc164d54c5b4e93463dcc9f40a7af"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arashm%2FJDate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arashm%2FJDate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arashm%2FJDate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arashm%2FJDate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arashm","download_url":"https://codeload.github.com/arashm/JDate/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246828490,"owners_count":20840473,"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","gregorian-converter","jalali","jdate","solar"],"created_at":"2024-11-07T03:41:12.728Z","updated_at":"2025-04-02T14:03:25.893Z","avatar_url":"https://github.com/arashm.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"JDate\n=====\n\n![Build Status](https://github.com/arashm/JDate/actions/workflows/node.js.yml/badge.svg?branch=master)\n[![NPM Version](https://img.shields.io/npm/v/jalali-date)](https://www.npmjs.com/package/jalali-date)\n[![NPM License](https://img.shields.io/npm/l/all-contributors.svg?style=flat)](https://github.com/arashm/JDate/blob/master/LICENSE)\n\nA Jalali to Gregorian converter in JavaScript with support of formatting output\n\n## Installation\n\nInstall via NPM/Yarn:\n\n```\nnpm install jalali-date\n```\n\nYou could grab the latest version from `lib` directory and use it:\n\n```html\n\u003chead\u003e\n  \u003cscript src=\"jdate.js\" type=\"text/javascript\" charset=\"utf-8\"\u003e\u003c/script\u003e\n  \u003cscript src=\"jdate.min.js\" type=\"text/javascript\" charset=\"utf-8\"\u003e\u003c/script\u003e\n\u003c/head\u003e\n```\n\nThe full-version is useful for debugging. You may want to use minified version in production as it is smaller.\n\n### Initialization\n\nFor initializing `JDate` you may either pass an array of Jalali date to it or a `Date` object. If no parameter is passed, the default is today:\n\n```javascript\nconst JDate = require('jalali-date');\nconst jdate = new JDate; // =\u003e default to today\nconst jdate2 = new JDate(1393, 10, 11);\nconst jdate3 = new JDate([1393, 10, 11]);\nconst jdate4 = new JDate(new Date(2014, 1, 3));\n\n```\n\n### API\n```javascript\njdate.date //=\u003e [1393, 5, 13] An Array of Jalali Date\njdate._d // =\u003e Gregorian Date Object\n\n// Getters\njdate.getFullYear() // =\u003e 1393\njdate.getMonth() // =\u003e 5\njdate.getDate() // =\u003e 13\njdate.getDay() // =\u003e 1\n\n// Setters\njdate.setFullYear(1394)\njdate.setMonth(6)\njdate.setDate(12)\n\n// Formatting output\njdate.format('dddd DD MMMM YYYY') // =\u003e پنج‌شنبه 12 شهریور 1394\n\n// Static functions\nJDate.isLeapYear(1393) // =\u003e false\nJDate.daysInMonth(1393, 5) // =\u003e 31\nJDate.toGregorian(1393, 12, 11) // =\u003e Gregorian Date object\nJDate.toJalali(new Date) // =\u003e JDate object\n```\n\n## Formatting output\nUse `format()` and following conversion identifiers as follows:\n\n```javascript\ndate.format('dddd DD MMMM YYYY') //=\u003e دوشنبه 6 امرداد 1393\n```\n\nThe conversion identifiers are as follows:\n\n| Identifier        | Description           | Example  |\n| ------------- | ------------- | ---------- |\n| `YYY` or `YYYY`      | Full Year (4 digits) | 1393 |\n| `YY`      | Year (2 digits)      |   93 |\n| `M` | Month in number      |  returns `5` for `امرداد`   |\n| `MM` | Month in number      |  returns `05` for `امرداد`   |\n| `MMM` or `MMMM` | Month in string | `امرداد` |\n| `D` | Day in number | 26 |\n| `DD` | Day in number | 06 |\n| `d` or `dd` | Abbreviation of day name in string | `۱ش` (for یکشنبه) |\n| `ddd` or `dddd` | Full day name in string | `یکشنبه` |\n\n\n## Contribute\n\nReport bugs and suggest feature in [issue tracker](https://github.com/arashm/Jalali-Calendar/issues). Feel free to `Fork` and send `Pull Requests`.\n\n## License\n\n[MIT](https://github.com/arashm/JDate/blob/master/LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farashm%2Fjdate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farashm%2Fjdate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farashm%2Fjdate/lists"}