1
0
mirror of https://github.com/morris/vanilla-todo.git synced 2025-08-22 13:43:06 +02:00

some cleanups

This commit is contained in:
Morris Brodersen
2022-07-22 16:43:29 +02:00
parent 77238353f9
commit e17050a266
17 changed files with 201 additions and 211 deletions

View File

@@ -2,6 +2,7 @@ export function uuid() {
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => {
const r = (Math.random() * 16) | 0,
v = c == 'x' ? r : (r & 0x3) | 0x8;
return v.toString(16);
});
}
@@ -21,6 +22,7 @@ export function formatDate(date) {
const m = formatMonth(date);
const d = formatDayOfMonth(date);
const y = date.getFullYear().toString().padStart(4, '0');
return `${m} ${d} ${y}`;
}