date format - jalalian

This commit is contained in:
mhsanaei
2024-07-13 01:38:51 +02:00
parent 8018023187
commit 76fdfb2ef2
6 changed files with 68 additions and 17 deletions

View File

@@ -128,7 +128,7 @@ Date.prototype.formatDateTime = function (split = ' ') {
};
class DateUtil {
// String string to date object
// String to date object
static parseDate(str) {
return new Date(str.replace(/-/g, '/'));
}
@@ -143,4 +143,9 @@ class DateUtil {
date.setMinTime();
return date;
}
static convertToJalalian(date) {
return date && moment.isMoment(date) ? date.format('jYYYY/jMM/jDD HH:mm:ss') : null;
}
}