In the name of Allah, the Beneficent, the Merciful.
Date and Time - SH (Solar Hijri, Shamsi Hijri, Iranian Hijri)
Language
Install
npm i shdate
Usage
- ES Modules (ESM):
import SHDate from "shdate";
var date = new SHDate();
- CommonJS (CJS):
const SHDate = require("shdate").default;
var date = new SHDate();
- TypeScript (TS):
const SHDate = require('shdate');
// OR
import SHDate from 'shdate';
var date = new SHDate();
- ES Modules for the browser:
<script type="module">
import SHDate from "shdate";
var date = new SHDate();
</script>
- client side for the browser:
<script
type="text/javascript"
src="/path/to/shdate/dist/browser/shdate.min.js"
></script>
<script>
var date = new SHDate();
</script>
jsdrive:
https://cdn.jsdelivr.net/npm/shdate@latest/dist/browser/shdate.min.js
ubpkg:
https://unpkg.com/shdate@latest/dist/browser/shdate.min.js
Note
- If you want to use ES Modules in Node.js without a transpiler, you need to add
"type": "module"
in yourpackage.json
or change your file extension from.js
to.mjs
.