From 76fdfb2ef2083563cebaca0f05d823653df18e05 Mon Sep 17 00:00:00 2001 From: mhsanaei Date: Sat, 13 Jul 2024 01:38:51 +0200 Subject: date format - jalalian --- web/assets/js/util/date-util.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'web/assets/js') diff --git a/web/assets/js/util/date-util.js b/web/assets/js/util/date-util.js index 5305455e..50efd6fe 100644 --- a/web/assets/js/util/date-util.js +++ b/web/assets/js/util/date-util.js @@ -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; + } + } -- cgit v1.2.3