Whenever I attempt to convert a Gregorian date to a Persian date, the minute value in the conversion ends up becoming an error.
For instance, let's say I want to convert this specific date and time to a Persian date:
2020-09-14T16:51:00+04:30
should be converted to 1399/06/24 16:51
. However, during the conversion process, instead of showing 16:51
, it incorrectly displays 00:06
.
This is the code that I am currently using for date conversion:
toPersianDate(date: any, format = 'YYYY/MM/DD HH:MM'): string {
let dateTime;
const MomentDate = moment(date, 'YYYY/MM/DD');
dateTime = MomentDate.locale('fa').format('jYYYY/jMM/jDD HH:jMM');
return dateTime;
}
I'm facing this issue with the minute values. How can I go about resolving this problem?