Update package-lock.json and enhance UptimeStatusIsland component for time formatting

- Updated package-lock.json to reflect new versions of dependencies, including luxon for date handling.
- Modified UptimeStatusIsland component to improve local time formatting, ensuring UTC display and handling of invalid dates.
This commit is contained in:
2025-06-11 20:44:32 +02:00
parent cdc09fc4a5
commit c067466894
3 changed files with 2767 additions and 2453 deletions

View File

@@ -44,11 +44,12 @@ function getUptime24hBg(uptime) {
return 'bg-red-600 text-white dark:bg-red-800 dark:text-white';
}
function formatLocalTime(utcTime) {
if (!utcTime) return '';
const dt = DateTime.fromISO(utcTime, { zone: 'utc' });
function formatLocalTime(rawTime) {
if (!rawTime) return '';
// Parse the API's custom format as UTC
const dt = DateTime.fromFormat(rawTime, 'yyyy-MM-dd HH:mm:ss.SSS', { zone: 'utc' });
// Always show in UTC, format: dd-MM-yyyy, HH:mm:ss UTC
return dt.toFormat('dd-MM-yyyy, HH:mm:ss') + ' UTC';
return dt.isValid ? dt.toFormat('dd-MM-yyyy, HH:mm:ss') + ' UTC' : 'Invalid DateTime UTC';
}
export default function UptimeStatusIsland() {