From 2770f0e8d8e84d1609103d874c132c4bece6a569 Mon Sep 17 00:00:00 2001 From: Max Date: Tue, 27 Jul 2021 23:45:49 +0200 Subject: [PATCH] Added date format helper --- src/services/helper.service.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/services/helper.service.js b/src/services/helper.service.js index 4a9578b..378cf99 100644 --- a/src/services/helper.service.js +++ b/src/services/helper.service.js @@ -73,6 +73,17 @@ export const helperService = { return correctDate.toISOString(); }, + /** + * Converts a date object into a date-time-timezone string and only keeps the date. + * + * @param {*} date A date object + * + * @returns Date as string in YYYY-MM-DD format + */ + toISODateOnly(date) { + return helperService.toISODate(date).substring(0, 10); + }, + /** * Adds current duration to a record. * Copied from original juggl code.