
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
shamsi-date-converter
Advanced tools
A Jalali to Gregorian and Gregorian to Jalali converter with no dependency!
This plugin convert jalali to gregorian and gregorian to jalali in the most simple way
Convert gregorian to jalali
shamsi.gregorianToJalali(1989, 1, 24); //[1367, 11, 4]
// OR
shamsi.gregorianToJalali('July 17, 1995 03:24:00'); //[1374, 4, 26]
// OR
const date = new Date('July 17, 1995 03:24:00');
shamsi.gregorianToJalali(date); //[1374, 4, 26]
Convert jalali to gregorian
shamsi.jalaliToGregorian(1367, 11, 4); //[1989, 1, 24]
Install via npm
npm install shamsi-date-converter -S
Install via yarn
yarn add shamsi-date-converter
Install it via npm or yarn then use it as the following code
var shamsi = require('shamsi-date-converter');
shamsi.gregorianToJalali('July 17, 1995 03:24:00'); //[1374, 4, 26]
get library using bower, npm, cdn, or cloning the repository
<script src="https://unpkg.com/shamsi-date-converter"></script>
<script>
shamsi.gregorianToJalali(1989, 1, 24);
</script>
import * as shamsi from 'shamsi-date-converter';
...
render() {
return (<p>{shamsi.gregorianToJalali(1989, 1, 24).join('/')}</p>);
}
get library using bower, npm, cdn, or cloning the repository
<script src="https://unpkg.com/shamsi-date-converter"></script>
<script>
$("#date").text(shamsi.gregorianToJalali(1989, 1, 24).join('/'));
</script>
If you don't need to pass date as input and you just want to pass year
, month
and date
, you have to use shamsi
If you want to pass formatted date as input or get formatted date from output like:
gregorianToJalali('1995/7/17'); // => 1374/4/26
// OR
jalaliToGregorian('1374/4/26'); // => 1995/7/17
// OR other formats as input or outputs
you have to use shamsi-formatter
FAQs
A minimal Jalali to Gregorian and Gregorian to Jalali converter
The npm package shamsi-date-converter receives a total of 1,596 weekly downloads. As such, shamsi-date-converter popularity was classified as popular.
We found that shamsi-date-converter demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.