Closed amSiddiqui closed 3 years ago
This issue is only presenting on my local machine and not on the deployed Server Instance. I suspect the issue is due to TimeZone. I was running some tests by changing the time values, but I wanted an opinion on the issue.
When I am passing a JS Date object as a constructor to NepaliDate, the stored Js date, in the instance, is 1 day behind the original JS date object. This is an example of the problem.
The format is done using Intl.DateTimeFormat.
let formatted = new Intl.DateTimeFormat('en-GB', {timeZone: process.env.TZ, month: '2-digit', day: "2-digit", year: "numeric"}).format(d);
Where
process.env.TZ = 'Asia/Kathmandu'