You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I use this picker but I want to get selected date in persian not like 'Mon Jan 20 2020 19:29:15 GMT+0000'
How to change this?
ok you can install 'moment-jalaali'
its a add-on for moments.js
const JNOW = require('moment-jalaali');
import fa from "moment/src/locale/fa";
JNOW.locale("fa", fa);
JNOW.loadPersian({ usePersianDigits: true });
function getDate(date){
const dte = JNOW(date).format('dddd jYY/jMM/jDD'); // or any format you wanna show
// یکشنبه 99/01/25
const today =JNOW().format('dddd jYY/jMM/jDD'); //returns today
}
this calendar return timestamp, you can convert it
and you can use to this solution:
after install this https://www.npmjs.com/package/moment-jalaali
you can use this package:
let mydate = new Date(timestamp);
var dataJalali = moment(mydate).format('jYYYY/jMM/jDD');
I use this picker but I want to get selected date in persian not like 'Mon Jan 20 2020 19:29:15 GMT+0000'
How to change this?
The text was updated successfully, but these errors were encountered: