{"id":18773021,"url":"https://github.com/pmzi/lahze","last_synced_at":"2026-03-04T07:33:55.536Z","repository":{"id":51639226,"uuid":"233227818","full_name":"pmzi/lahze","owner":"pmzi","description":":calendar: Lightweight package for formatting dates between jalali and gregorian","archived":false,"fork":false,"pushed_at":"2023-06-06T07:37:10.000Z","size":286,"stargazers_count":5,"open_issues_count":4,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-26T19:57:07.104Z","etag":null,"topics":["date","format-time","format-time-date","gregorian","gregorian-converter","jalali","jalali-converter","jalalidate","persian","persian-date","time"],"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/pmzi.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":"2020-01-11T12:24:56.000Z","updated_at":"2023-06-06T07:01:58.000Z","dependencies_parsed_at":"2024-11-07T19:36:17.372Z","dependency_job_id":"c3531022-2b64-4637-b630-855198d451d2","html_url":"https://github.com/pmzi/lahze","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/pmzi/lahze","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pmzi%2Flahze","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pmzi%2Flahze/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pmzi%2Flahze/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pmzi%2Flahze/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pmzi","download_url":"https://codeload.github.com/pmzi/lahze/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pmzi%2Flahze/sbom","scorecard":{"id":738994,"data":{"date":"2025-08-11","repo":{"name":"github.com/pmzi/lahze","commit":"322700f1bbc69b81ee79f43721293567820a6cfd"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.7,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":0,"reason":"43 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-6chw-6frg-f759","Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-pp7h-53gx-mx7r","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-cwfw-4gq5-mrqx","Warn: Project is vulnerable to: GHSA-g95f-p29q-9xw4","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-w8qv-6jwh-64r5","Warn: Project is vulnerable to: GHSA-257v-vj4p-3w2h","Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c","Warn: Project is vulnerable to: GHSA-ff7x-qrg7-qggm","Warn: Project is vulnerable to: GHSA-qqgx-2p2h-9c37","Warn: Project is vulnerable to: GHSA-7r28-3m3f-r2pr","Warn: Project is vulnerable to: GHSA-r8j5-h5cx-65gg","Warn: Project is vulnerable to: GHSA-2pr6-76vf-7546","Warn: Project is vulnerable to: GHSA-8j8c-7jfh-h6hx","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-6c8f-qphg-qjgp","Warn: Project is vulnerable to: GHSA-76p3-8jx3-jpfq","Warn: Project is vulnerable to: GHSA-3rfm-jhwj-7488","Warn: Project is vulnerable to: GHSA-hhq3-ff78-jv3g","Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw","Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9","Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-rp65-9cf3-cjxr","Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9","Warn: Project is vulnerable to: GHSA-566m-qj78-rww5","Warn: Project is vulnerable to: GHSA-7fh5-64p2-3v2j","Warn: Project is vulnerable to: GHSA-hwj9-h5mp-3pm3","Warn: Project is vulnerable to: GHSA-gcx4-mw62-g8wm","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-h9rv-jmmf-4pgx","Warn: Project is vulnerable to: GHSA-hxcc-f52p-wc94","Warn: Project is vulnerable to: GHSA-wpg7-2c88-r8xv","Warn: Project is vulnerable to: GHSA-pq67-2wwv-3xjx","Warn: Project is vulnerable to: GHSA-8cj5-5rvv-wf4v","Warn: Project is vulnerable to: GHSA-4wf5-vphf-c2xc"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-22T16:48:53.570Z","repository_id":51639226,"created_at":"2025-08-22T16:48:53.570Z","updated_at":"2025-08-22T16:48:53.570Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30075438,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-04T05:31:57.858Z","status":"ssl_error","status_checked_at":"2026-03-04T05:31:38.462Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":["date","format-time","format-time-date","gregorian","gregorian-converter","jalali","jalali-converter","jalalidate","persian","persian-date","time"],"created_at":"2024-11-07T19:32:22.164Z","updated_at":"2026-03-04T07:33:55.516Z","avatar_url":"https://github.com/pmzi.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Lahze\n![npm bundle size](https://img.shields.io/bundlephobia/minzip/lahze)\n[![install size](https://packagephobia.now.sh/badge?p=hod)](https://packagephobia.now.sh/result?p=lahze)\n\nLightweight package for formatting dates between jalali and gregorian. Supports both `node` and `browser` environments.\n\n\n## Usage\n\n### Basic usage\n\n`lahze` can be initialized using 3 arguments: date, format of the date and locale.\n\nAfter that `lahze` can manipulate and display date between locales easily.\n\n```js\nimport lahze from 'lahze';\n\nlahze('1398/10/10', 'YYYY/MM/DD', 'fa').format('YYYY/MM/DD', 'en'); // 2019/12/31\n```\n\n* Date can be on of the following items:\n  1. Instance of `Date` object\n  2. String with a specific format\n  3. Timestamp\n\n  **If date is not specified or null, it will be equal to today.**\n\n* Format accepted types are as followed:\n  * `YYYY`: full year (4 digits).\n  * `YY`: short year (last 2 digits).\n  * `MM`: full month (2 digits).\n  * `M`: short month (1-2 digit).\n  * `DD`: full day (2 digits).\n  * `D`: short day (1-2 digits).\n  * `HH`: full hours (2 digits).\n  * `H`: short hours (1-2 digits).\n  * `mm`: full minutes (2 digits).\n  * `m`: short minutes (1-2 digits).\n  * `ss`: full seconds (2 digits).\n  * `s`: short seconds (1-2 digits).\n  * Supported delimiters are `\\`, `/`, `-`, `:`.\n\n  **If format is not specified or null, it will be equal to whatever `Date` object accepts.**\n\n* Locale can be either fa or en (defaults en).\n\nAfter initializing `lahze` with the desired arguments, you can easily manupulate date and display it with a specific format at the end.\n\n### Manipulating\n\n#### Setters\n\n##### setFullYear\n\nThis method accepts 4-digits year as the first argument and locale as it's second argument which specifies the locale of the first argument (defaults to initial locale which was specified by creating `lahze` instance).\n\n```js\nlahze('1398/10/10', 'YYYY/MM/DD', 'fa').setFullYear(1399, 'fa'); // 1399/10/10\n```\n\n##### setMonth\n\nThis method accepts month (value between 1 and 12) as the first argument and locale as it's second argument which specifies the locale of the first argument (defaults to initial locale which was specified by creating `lahze` instance).\n\n```js\nlahze('1398/10/10', 'YYYY/MM/DD', 'fa').setMonth(12, 'fa'); // 1398/12/10\n```\n\n##### setDay\n\nThis method accepts day of the month (value between 1 and 31) as the first argument and locale as it's second argument which specifies the locale of the first argument (defaults to initial locale which was specified by creating `lahze` instance).\n\n```js\nlahze('1398/10/10', 'YYYY/MM/DD', 'fa').setDay(5, 'fa'); // 1398/10/5\n```\n\n##### setHours\n\nThis method accepts hours (value between 0 and 23) as the first argument.\n\n```js\nlahze('1398/10/10 12:00:00', 'YYYY/MM/DD HH:mm:ss', 'fa').setHours(5); // 1398/10/10 5:00:00\n```\n\n##### setMinutes\n\nThis method accepts minutes (value between 0 and 59) as the first argument.\n\n```js\nlahze('1398/10/10 12:00:00', 'YYYY/MM/DD HH:mm:ss', 'fa').setHours(50); // 1398/10/10 12:50:00\n```\n\n##### setSeconds\n\nThis method accepts minutes (value between 0 and 59) as the first argument.\n\n```js\nlahze('1398/10/10 12:00:00', 'YYYY/MM/DD HH:mm:ss', 'fa').setHours(10); // 1398/10/10 12:00:10\n```\n\n#### Getters\n\n##### getFullYear\n\nThis method returns full year (4-digits) of the `lahze` instance.\n\nThis method accepts locale as the first argument which specifies the locale of the returning value (defaults to initial locale which was specified by creating `lahze` instance).\n\n```js\nlahze('1398/10/10', 'YYYY/MM/DD', 'fa').getFullYear('en'); // 2019\n\nlahze('1398/10/10', 'YYYY/MM/DD', 'fa').getFullYear('fa'); // 1398\n```\n\n##### getMonth\n\nThis method returns month number (1-12) of the `lahze` instance.\n\nThis method accepts locale as the first argument which specifies the locale of the returning value (defaults to initial locale which was specified by creating `lahze` instance).\n\n```js\nlahze('1398/10/10', 'YYYY/MM/DD', 'fa').getMonth('fa'); // 10\n\nlahze('1398/10/10', 'YYYY/MM/DD', 'fa').getMonth('en'); // 12\n```\n\n##### getDay\n\nThis method returns day of the month of the `lahze` instance.\n\nThis method accepts locale as the first argument which specifies the locale of the returning value (defaults to initial locale which was specified by creating `lahze` instance).\n\n```js\nlahze('1398/10/10', 'YYYY/MM/DD', 'fa').getDay('fa'); // 10\n\nlahze('1398/10/10', 'YYYY/MM/DD', 'fa').getDay('en'); // 31\n```\n\n##### getHours\n\nThis method returns hours of the month of the `lahze` instance.\n\n```js\nlahze('1398/10/10 12:00:00', 'YYYY/MM/DD HH:mm:ss', 'fa').getHours(); // 12\n```\n\n##### getMinutes\n\nThis method returns hours of the month of the `lahze` instance.\n\n```js\nlahze('1398/10/10 12:20:00', 'YYYY/MM/DD HH:mm:ss', 'fa').getMinutes(); // 20\n```\n\n##### getSeconds\n\nThis method returns hours of the month of the `lahze` instance.\n\n```js\nlahze('1398/10/10 12:00:50', 'YYYY/MM/DD HH:mm:ss', 'fa').getSeconds(); // 50\n```\n\n## Advanced manipulation\n\nYou can set the year, month or day in a locale and get it in the opposite locale:\n\n```js\nlahze('1398/10/10', 'YYYY/MM/DD', 'fa').setMonth(11, 'en').getMonth('fa'); // 8\n```\n\n### Display\n\n`lahze` can return date in the given format with the desired locale:\n\n```js\nlahze('1398/10/10', 'YYYY/MM/DD', 'fa').format('YYYY/MM/DD', 'en'); // 2019/12/31\n```\n\n**Supported formats are listed above.**\n\n## License\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpmzi%2Flahze","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpmzi%2Flahze","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpmzi%2Flahze/lists"}