mirror of
https://github.com/seanmorley15/AdventureLog.git
synced 2026-05-18 11:47:04 -04:00
Show timezone information on visits list (#865)
* Initial plan * Initial investigation: Show timezone on visits list - planning implementation Co-authored-by: seanmorley15 <98704938+seanmorley15@users.noreply.github.com> * Show timezone on visits list - add timezone badge display Co-authored-by: seanmorley15 <98704938+seanmorley15@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: seanmorley15 <98704938+seanmorley15@users.noreply.github.com>
This commit is contained in:
5551
frontend/package-lock.json
generated
Normal file
5551
frontend/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
|||||||
export default {
|
export default {
|
||||||
plugins: {
|
plugins: {
|
||||||
tailwindcss: {},
|
tailwindcss: {},
|
||||||
autoprefixer: {},
|
autoprefixer: {}
|
||||||
},
|
}
|
||||||
}
|
};
|
||||||
|
|||||||
@@ -64,7 +64,7 @@
|
|||||||
ja: '日本語',
|
ja: '日本語',
|
||||||
ar: 'العربية',
|
ar: 'العربية',
|
||||||
'pt-br': 'Português (Brasil)',
|
'pt-br': 'Português (Brasil)',
|
||||||
'sk': 'Slovenský'
|
sk: 'Slovenský'
|
||||||
};
|
};
|
||||||
|
|
||||||
const submitLocaleChange = (event: Event) => {
|
const submitLocaleChange = (event: Event) => {
|
||||||
|
|||||||
@@ -899,6 +899,9 @@
|
|||||||
{:else}
|
{:else}
|
||||||
<ClockIcon class="w-3 h-3 text-base-content/50" />
|
<ClockIcon class="w-3 h-3 text-base-content/50" />
|
||||||
{/if}
|
{/if}
|
||||||
|
{#if visit.timezone && !isAllDay(visit.start_date)}
|
||||||
|
<span class="badge badge-outline badge-sm">{visit.timezone}</span>
|
||||||
|
{/if}
|
||||||
<div class="text-sm font-medium truncate">
|
<div class="text-sm font-medium truncate">
|
||||||
{#if isAllDay(visit.start_date)}
|
{#if isAllDay(visit.start_date)}
|
||||||
{visit.start_date && typeof visit.start_date === 'string'
|
{visit.start_date && typeof visit.start_date === 'string'
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -5,56 +5,56 @@ import { build, files, version } from '$service-worker';
|
|||||||
const CACHE = `cache-${version}`;
|
const CACHE = `cache-${version}`;
|
||||||
|
|
||||||
const ASSETS = [
|
const ASSETS = [
|
||||||
...build, // the app itself
|
...build, // the app itself
|
||||||
...files // everything in `static`
|
...files // everything in `static`
|
||||||
];
|
];
|
||||||
|
|
||||||
self.addEventListener('install', (event) => {
|
self.addEventListener('install', (event) => {
|
||||||
// Create a new cache and add all files to it
|
// Create a new cache and add all files to it
|
||||||
async function addFilesToCache() {
|
async function addFilesToCache() {
|
||||||
const cache = await caches.open(CACHE);
|
const cache = await caches.open(CACHE);
|
||||||
await cache.addAll(ASSETS);
|
await cache.addAll(ASSETS);
|
||||||
}
|
}
|
||||||
event.waitUntil(addFilesToCache());
|
event.waitUntil(addFilesToCache());
|
||||||
});
|
});
|
||||||
|
|
||||||
self.addEventListener('activate', (event) => {
|
self.addEventListener('activate', (event) => {
|
||||||
// Remove previous cached data from disk
|
// Remove previous cached data from disk
|
||||||
async function deleteOldCaches() {
|
async function deleteOldCaches() {
|
||||||
for (const key of await caches.keys()) {
|
for (const key of await caches.keys()) {
|
||||||
if (key !== CACHE) await caches.delete(key);
|
if (key !== CACHE) await caches.delete(key);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
event.waitUntil(deleteOldCaches());
|
event.waitUntil(deleteOldCaches());
|
||||||
});
|
});
|
||||||
|
|
||||||
self.addEventListener('fetch', (event) => {
|
self.addEventListener('fetch', (event) => {
|
||||||
// ignore POST requests, etc
|
// ignore POST requests, etc
|
||||||
if (event.request.method !== 'GET') return;
|
if (event.request.method !== 'GET') return;
|
||||||
|
|
||||||
async function respond() {
|
async function respond() {
|
||||||
const url = new URL(event.request.url);
|
const url = new URL(event.request.url);
|
||||||
const cache = await caches.open(CACHE);
|
const cache = await caches.open(CACHE);
|
||||||
|
|
||||||
// `build`/`files` can always be served from the cache
|
// `build`/`files` can always be served from the cache
|
||||||
if (ASSETS.includes(url.pathname)) {
|
if (ASSETS.includes(url.pathname)) {
|
||||||
return cache.match(url.pathname);
|
return cache.match(url.pathname);
|
||||||
}
|
}
|
||||||
|
|
||||||
// for everything else, try the network first, but
|
// for everything else, try the network first, but
|
||||||
// fall back to the cache if we're offline
|
// fall back to the cache if we're offline
|
||||||
try {
|
try {
|
||||||
const response = await fetch(event.request);
|
const response = await fetch(event.request);
|
||||||
|
|
||||||
if (response.status === 200) {
|
if (response.status === 200) {
|
||||||
cache.put(event.request, response.clone());
|
cache.put(event.request, response.clone());
|
||||||
}
|
}
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
} catch {
|
} catch {
|
||||||
return cache.match(event.request);
|
return cache.match(event.request);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
event.respondWith(respond());
|
event.respondWith(respond());
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
{
|
{
|
||||||
"short_name": "AdventureLog",
|
"short_name": "AdventureLog",
|
||||||
"name": "AdventureLog",
|
"name": "AdventureLog",
|
||||||
"start_url": "/dashboard",
|
"start_url": "/dashboard",
|
||||||
"icons": [
|
"icons": [
|
||||||
{
|
{
|
||||||
"src": "adventurelog.svg",
|
"src": "adventurelog.svg",
|
||||||
"type": "image/svg+xml",
|
"type": "image/svg+xml",
|
||||||
"sizes": "any"
|
"sizes": "any"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"background_color": "#2a323c",
|
"background_color": "#2a323c",
|
||||||
"display": "standalone",
|
"display": "standalone",
|
||||||
"scope": "/",
|
"scope": "/",
|
||||||
"description": "Self-hostable travel tracker and trip planner."
|
"description": "Self-hostable travel tracker and trip planner."
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user