From 7231b5bb8137bb26ae9ef91bc6bfaaaefe95976f Mon Sep 17 00:00:00 2001 From: G-nizam-A Date: Tue, 19 Mar 2024 15:46:17 +0530 Subject: [PATCH] Feat: Localization of dates/times #4584 --- src/mixins/datetime.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/mixins/datetime.js b/src/mixins/datetime.js index 1946d190..d30e79de 100644 --- a/src/mixins/datetime.js +++ b/src/mixins/datetime.js @@ -92,7 +92,11 @@ export default { */ datetimeFormat(value, format) { if (value !== undefined && value !== "") { - return dayjs.utc(value).tz(this.timezone).format(format); + const date = new Date(value); + return date.toLocaleString(this.$i18n.locale, { ...format, + hour12: false }); // 24 hour format + // return date.toLocaleString(this.$i18n.locale, format); // 12 hours format + // return dayjs.utc(value).tz(this.timezone).format(format); } return ""; },