Open darushHamidi opened 2 years ago
try this:
const date = moment.from(persianDate, 'fa', 'YYYY/MM/DD').locale('en').format('YYYY/MM/DD').replace(/\//g, '-');
console.log(new Date(date))
Hi please create a demo for the issues I have created a demo and seems it works well https://stackblitz.com/edit/jalali-moment-demo-react-iewto2?file=index.js
I have the same issue. When converting a gregorian date to persian date. The date comes back !
I convert the Shamsi date to gregorian date with the following snippet:
Now, the day is 23, After converting the result to the date object the day will get 22, Why?
const date = new Date(result); // 2022-08-22T19:30:00.000Z