From 92bd09355b830c5bae4f8ba3a901aa86ed65455a Mon Sep 17 00:00:00 2001 From: SimonGschnell Date: Wed, 23 Jul 2025 11:25:13 +0200 Subject: [PATCH] update(News widget): adds number padding for the date and the time stamp in the news widget --- public/js/components/DashboardWidget/News.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/public/js/components/DashboardWidget/News.js b/public/js/components/DashboardWidget/News.js index 247f04b40..d86ccff0b 100644 --- a/public/js/components/DashboardWidget/News.js +++ b/public/js/components/DashboardWidget/News.js @@ -1,6 +1,6 @@ import AbstractWidget from './Abstract.js'; import BsModal from '../Bootstrap/Modal.js'; - +import { numberPadding } from '../../helpers/DateHelpers.js'; import ApiCms from '../../api/factory/cms.js'; const MAX_LOADED_NEWS = 30; @@ -89,11 +89,11 @@ export default { }, formatDate: function (dateTime) { const dt = new Date(dateTime); - return dt.getDate() + '.' + (dt.getMonth() + 1) + '.' + dt.getFullYear(); + return numberPadding(dt.getDate()) + '.' + numberPadding((dt.getMonth() + 1)) + '.' + dt.getFullYear(); }, formatTime: function (dateTime) { const dt = new Date(dateTime); - return dt.getHours() + ':' + dt.getMinutes(); + return numberPadding(dt.getHours()) + ':' + numberPadding(dt.getMinutes()); }, isString(value){ return Object.prototype.toString.call(value) === '[object String]';