1
0
Fork 0
mirror of https://github.com/seanmorley15/AdventureLog.git synced 2025-07-20 21:39:37 +02:00

Replace crypto.randomUUID with a unique ID generation method for visit objects and timezone selector instance

This commit is contained in:
Sean Morley 2025-05-11 11:50:29 -04:00
parent 4af80eb584
commit 6de737bbf8
2 changed files with 7 additions and 3 deletions

View file

@ -141,9 +141,12 @@
}
function createVisitObject(): Visit | TransportationVisit {
// Generate a unique ID using built-in methods
const uniqueId = Date.now().toString(36) + Math.random().toString(36).substring(2);
if (type === 'transportation') {
const transportVisit: TransportationVisit = {
id: crypto.randomUUID(),
id: uniqueId,
start_date: utcStartDate ?? '',
end_date: utcEndDate ?? utcStartDate ?? '',
notes: note ?? '',
@ -153,7 +156,7 @@
return transportVisit;
} else {
const regularVisit: Visit = {
id: crypto.randomUUID(),
id: uniqueId,
start_date: utcStartDate ?? '',
end_date: utcEndDate ?? utcStartDate ?? '',
notes: note ?? '',