Skip to content

Development#16

Merged
kenken64 merged 9 commits into
mainfrom
development
Jan 25, 2026
Merged

Development#16
kenken64 merged 9 commits into
mainfrom
development

Conversation

@kenken64

Copy link
Copy Markdown
Owner

No description provided.

kenken64 and others added 9 commits January 25, 2026 06:44
- Add formatDateInTimezone and formatDateTimeInTimezone utilities
- GalleryPage fetches user's saved timezone from settings
- GalleryCard displays created date in user's timezone
- ImageDetailModal displays created date/time in user's timezone
- Falls back to browser timezone if user timezone not set

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- ScheduleCard now displays next run date and scheduled_at in user's timezone
- BatchCard now displays created date in user's timezone
- Both pages fetch user's saved timezone from settings
- Falls back to browser timezone if not set

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Only override browser timezone if user has explicitly set a timezone
- If database returns default "UTC", keep using browser-detected timezone
- Fixes dates showing in UTC instead of local time for new users

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- formatDateInTimezone and formatDateTimeInTimezone now omit timeZone
  option when timezone is empty or "UTC", allowing browser locale to be used
- Changed toLocaleDateString to toLocaleString for datetime formatting
- Simplified components to always use timezone functions (they handle fallback)
- Fixes dates showing in UTC instead of browser's local timezone

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
… functions

When timezone is empty or "UTC" (database default), now explicitly
detects the browser's timezone instead of relying on browser locale.
This ensures dates are always displayed in the user's local timezone.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
SQLite's CURRENT_TIMESTAMP stores dates in UTC but without timezone
indicator (e.g., "2024-01-25 10:30:00"). JavaScript's new Date() parses
this as local time instead of UTC, causing timezone offset issues.

Added toISODate() utility to convert SQLite dates to proper ISO 8601
format with "Z" suffix (e.g., "2024-01-25T10:30:00Z").

Updated all API routes to use toISODate() when returning dates:
- gallery.ts: createdAt in image responses
- batch-service.ts: all batch job and item date fields
- schedule.ts: scheduled_at, last_run_at, next_run_at, created_at
- admin.ts: device created_at and updated_at
- share.ts: createdAt and expiresAt
- devices.ts: created_at and updated_at

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The scheduled_at field stores the user's input in local time format,
not UTC. Adding "Z" suffix incorrectly claimed it was UTC, causing
an 8-hour offset when displaying in Singapore timezone.

- Backend: Don't add "Z" to scheduled_at since it's local time
- Frontend: Display scheduled_at without timezone conversion

Other date fields (next_run_at, created_at, etc.) are stored in UTC
and correctly have "Z" suffix.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
When a scheduled job fails (e.g., content policy violation), the error
is now captured and displayed on the frontend.

Backend changes:
- Add last_error and last_error_at columns to scheduled_jobs table
- Update scheduler service to save error on failure and clear on success
- Failed one-time jobs are disabled but retain the error message
- Recurring jobs continue to retry with next scheduled time

Frontend changes:
- Add error display in ScheduleCard with red alert styling
- Show error message and "Last error" label
- Add translations for lastError in English and Chinese

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The limit is for saved schedule configurations, not concurrent runs.
10 was too restrictive for users who want multiple schedules.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@kenken64 kenken64 merged commit d98fe75 into main Jan 25, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant