refactor utils

This commit is contained in:
2024-05-13 12:31:27 -04:00
parent 78211a33ae
commit b0921ccf32
4 changed files with 15 additions and 17 deletions

11
src/utils/misc.ts Normal file
View File

@@ -0,0 +1,11 @@
export function buildISODate(date: string, time: string | null): string {
return new Date(date + 'T' + time || '00:00').toISOString();
}
export function getNewId(): string {
return [...Array(20)]
.map(() => Math.floor(Math.random() * 16).toString(16))
.join('');
// Trivial placeholder
//return Math.max(...reservations.value.map((item) => item.id)) + 1;
}