diff --git a/src/services/helper.service.js b/src/services/helper.service.js index 378cf99..5557856 100644 --- a/src/services/helper.service.js +++ b/src/services/helper.service.js @@ -64,13 +64,17 @@ export const helperService = { * @returns Date as string in the used format */ toISODate(date) { - var timezoneOffset = date.getMinutes() + date.getTimezoneOffset(); - var timestamp = date.getTime() + timezoneOffset * 1000; - var correctDate = new Date(timestamp); - - correctDate.setUTCHours(0, 0, 0, 0); - - return correctDate.toISOString(); + return ( + date.getFullYear() + + "-" + + (date.getMonth() + 1).toString().padStart(2, "0") + + "-" + + date + .getDate() + .toString() + .padStart(2, "0") + + "T00:00.000Z" + ); }, /** @@ -81,6 +85,7 @@ export const helperService = { * @returns Date as string in YYYY-MM-DD format */ toISODateOnly(date) { + console.log(helperService.toISODate(date)); return helperService.toISODate(date).substring(0, 10); },