Repository navigation
Conversation
Notification messages format dates with date-fns `format(date, "PP")` / `format(date, "pp")` without a locale, so times are always rendered in 12-hour US style (e.g. "1:49:41 PM"), regardless of the server locale. Add `formatNotificationDate`, `formatNotificationTime` and `formatNotificationDateTime` helpers that read two optional env vars: - NOTIFICATIONS_DATE_FORMAT (default: "PP") - NOTIFICATIONS_TIME_FORMAT (default: "pp") Defaults keep the current output unchanged. Invalid patterns fall back to the defaults instead of breaking the notification.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is this PR about?
Notification messages (Telegram, Slack, Discord, Mattermost, Lark, email, etc.) format dates with
format(date, "PP")/format(date, "pp")from date-fns without a locale, so times always render in 12-hour US style (e.g.1:49:41 PM). Users outside the US have no way to get 24-hour time or a local date format.This PR adds two optional environment variables:
NOTIFICATIONS_DATE_FORMATPPdd/MM/yyyyNOTIFICATIONS_TIME_FORMATppHH:mm:ss(24-hour)How
utils/notifications/utils.ts:formatNotificationDate,formatNotificationTime,formatNotificationDateTime.format(date, "PP" | "pp" | "PP pp")calls in the notification senders now use these helpers (build-error, build-success, database-backup, docker-cleanup, dokploy-backup, dokploy-restart, volume-backup).Usage
Happy to move this to a setting in the UI instead if you prefer that approach.
Checklist
Before submitting this PR, please make sure that:
canarybranch.Opened as draft until it's tested on a local instance.
biome checkpasses on the changed files.Issues related (if applicable)
N/A
Screenshots (if applicable)
N/A