Fix DateTime

This commit is contained in:
Andrey Hohutkin
2023-06-05 01:15:59 +03:00
parent 42410c8df6
commit 4b55c4bf40
3 changed files with 3 additions and 3 deletions

View File

@@ -117,7 +117,7 @@ function datetimeController() {
// parse out the date and time into constants.
const today = new Date();
const month = (today.getMonth() + '').length === 2 ? today.getMonth() + 1 : '0' + (today.getMonth() + 1);
const day = (today.getDate() + '').length === 2 ? today.getDate() + 1 : '0' + (today.getDate() + 1);
const day = (today.getDate() + '').length === 2 ? today.getDate() : '0' + today.getDate();
const dayOfWeek = (today.getDay() + '').length === 2 ? today.getDay() + 1 : '0' + (today.getDay() + 1);
const year = today.getFullYear() + '';
const hour = (today.getHours() + '').length === 2 ? today.getHours() : '0' + today.getHours();