Added date format helper

This commit is contained in:
Maximilian Giller 2021-07-27 23:45:49 +02:00
parent 1f4bc947b4
commit 2770f0e8d8

View file

@ -73,6 +73,17 @@ export const helperService = {
return correctDate.toISOString(); 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. * Adds current duration to a record.
* Copied from original juggl code. * Copied from original juggl code.