fix: address PR review findings for widget-only integration refactor
- Fix npm scoped package support (filter time metadata keys, make description optional, exclude falsy releases from version selection) - Fix timetable date formatting (use Intl.DateTimeFormat for stable MM/DD/YYYY output) and named zod import - Guard migration 0000 against unknown provider keys - Fix migration 0003 to delete integration links by integrationId - Reset immich album carousel index when photo list changes - Add bounded limit to timetable router input - Remove stale misspelled noProviderSeleceted translation key - Fix provider name visibility in release widget settings - Update docs: add ArchiveTeam Warrior note, fix typos, correct showPhotoInfo default
This commit is contained in:
44 files changed
+46
-76
No files matched your search
@@ -1,5 +1,5 @@
|
||||
import dayjs from "dayjs";
|
||||
import z from "zod/v4";
|
||||
import { z } from "zod/v4";
|
||||
|
||||
import { ResponseError } from "@homarr/common/server";
|
||||
import { fetchWithTrustedCertificatesAsync } from "@homarr/core/infrastructure/http";
|
||||
@@ -88,7 +88,18 @@ const getTimetableAsync = async (
|
||||
options: { stationId: string; limit: number },
|
||||
): Promise<Timetable> => {
|
||||
const now = new Date();
|
||||
const [date, time] = now.toLocaleString("en-CH", { timeZone: "Europe/Zurich" }).split(", ") as [string, string];
|
||||
const date = new Intl.DateTimeFormat("en-US", {
|
||||
timeZone: "Europe/Zurich",
|
||||
month: "2-digit",
|
||||
day: "2-digit",
|
||||
year: "numeric",
|
||||
}).format(now);
|
||||
const time = new Intl.DateTimeFormat("en-GB", {
|
||||
timeZone: "Europe/Zurich",
|
||||
hour: "2-digit",
|
||||
minute: "2-digit",
|
||||
hour12: false,
|
||||
}).format(now);
|
||||
const response = await fetchWithTrustedCertificatesAsync(
|
||||
buildUrl(baseUrl, "/timetable/api/stationboard.json", {
|
||||
stop: options.stationId,
|
||||
@@ -96,7 +107,7 @@ const getTimetableAsync = async (
|
||||
show_delays: 1,
|
||||
show_tracks: 1,
|
||||
date,
|
||||
time: time.substring(0, 5),
|
||||
time,
|
||||
}),
|
||||
);
|
||||
if (!response.ok) throw new ResponseError(response);
|
||||
|
||||
Reference in new issue
Block a user