Date and Time - SH (Solar Hijri, Shamsi Hijri, Iranian Hijri)
npm i shdate
- 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
- 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
.
- SHDate
- SHDate() constructor
- setWeek(): ( en | fa )
- setDateOfDayOfYear(): ( en | fa )
- setUTCDateOfDayOfYear(): ( en | fa )
- getDayOfYear(): ( en | fa )
- getUTCDayOfYear(): ( en | fa )
- getDaysInYear(): ( en | fa )
- getUTCDaysInYear(): ( en | fa )
- getWeekOfYear(): ( en | fa )
- getUTCWeekOfYear(): ( en | fa )
- getWeeksInYear(): ( en | fa )
- getUTCWeeksInYear(): ( en | fa )
- getDaysInMonth(): ( en | fa )
- getUTCDaysInMonth(): ( en | fa )
- getDates(): ( en | fa )
- getUTCDates(): ( en | fa )
- toUTCDateString(): ( en | fa )
- getUTCTime(): ( en | fa )
- restTime(): ( en | fa )
- restUTCTime(): ( en | fa )
- getLanguage(): ( en | fa )
- getFirstDayOfWeek(): ( en | fa )
- getTimeServerDiff(): ( en | fa )
- getTimeZone(): ( en | fa )
- setTimeServerDiff(): ( en | fa )
- setTimeZone(): ( en | fa )
- setLanguage(): ( en | fa )
- setFirstDayOfWeek(): ( en | fa )
- setConfig(): ( en | fa )
- instance(): ( en | fa )
- getVersion(): ( en | fa )
- NumbersTo(): ( en | fa )
- getNthWeekdayOfMonth(): ( en | fa )
- getFirstWeekdayOfMonth(): ( en | fa )
- getLastWeekdayOfMonth(): ( en | fa )
- WeekdayInMonth(): ( en | fa )
- getWeekdayInMonth(): ( en | fa )
- copy(): ( en | fa )
- this(): ( en | fa )