1
0
Fork 0
mirror of https://github.com/seanmorley15/AdventureLog.git synced 2025-07-19 04:49:37 +02:00

feat: Update Visit model to use DateTimeField for start and end dates, and enhance AdventureModal with datetime-local inputs

This commit is contained in:
Sean Morley 2025-03-18 14:04:31 -04:00
parent 6f720a154f
commit 9fd2a142cb
6 changed files with 152 additions and 35 deletions

View file

@ -338,6 +338,12 @@ export let LODGING_TYPES_ICONS = {
other: '❓'
};
// Helper to check if a given date string represents midnight (all-day)
export function isAllDay(dateStr: string | string[]) {
// Checks for the pattern "T00:00:00.000Z"
return dateStr.includes('T00:00:00Z') || dateStr.includes('T00:00:00.000Z');
}
export function getAdventureTypeLabel(type: string) {
// return the emoji ADVENTURE_TYPE_ICONS label for the given type if not found return ? emoji
if (type in ADVENTURE_TYPE_ICONS) {