diff --git a/CHANGELOG.md b/CHANGELOG.md index 26b20d6e5..929e0b718 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## Next release +## v6.3.40 2025 February 24 + +- Fix a bug: machine reservation time in my reservations is incorrect + ## v6.3.39 2025 February 3 - Fix a bug: unable to cancel a PayZen subscription diff --git a/app/frontend/src/javascript/lib/format.ts b/app/frontend/src/javascript/lib/format.ts index 3325710e9..a2e3c4395 100644 --- a/app/frontend/src/javascript/lib/format.ts +++ b/app/frontend/src/javascript/lib/format.ts @@ -62,7 +62,7 @@ export default class FormatLib { */ private static parseISOtime = (date: TDateISO|TDateISOShortTime): Date => { const isoTimeMatch = (date as string)?.match(/(^|T)(\d\d:\d\d)/); - return new Date(`1970-01-01T${isoTimeMatch[2]}:00${Fablab.timezone_offset}`); + return new Date(`${moment().format('YYYY-MM-DD')}T${isoTimeMatch[2]}:00${Fablab.timezone_offset}`); }; /** @@ -77,10 +77,10 @@ export default class FormatLib { */ static time = (date: Date|TDateISO|TDateISOShortTime): string => { let tempDate: Date; - if (FormatLib.isShortTimeISO(date as string) || FormatLib.isDateISO(date as string)) { + if (FormatLib.isShortTimeISO(date as string)) { tempDate = FormatLib.parseISOtime(date as TDateISOShortTime); } else { - tempDate = moment(date).toDate(); + tempDate = moment.utc(date).toDate(); } return Intl.DateTimeFormat(Fablab.intl_locale, { hour: 'numeric', minute: 'numeric', timeZone: Fablab.timezone }).format(tempDate); }; diff --git a/package.json b/package.json index 78147bc95..8f7a49b6c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fab-manager", - "version": "6.3.39", + "version": "6.3.40", "description": "Fab-manager is the FabLab management solution. It provides a comprehensive, web-based, open-source tool to simplify your administrative tasks and your marker's projects.", "keywords": [ "fablab",