-
Notifications
You must be signed in to change notification settings - Fork 125
DT-3307 - add custom timestamp formats #3021
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
src/lib/stores/time-format.ts
Outdated
| export const timestampFormats = { | ||
| short: 'do MMM yyyy H:mm:ss.SS', | ||
| medium: 'yyyy-MM-dd z HH:mm:ss.SS', | ||
| long: 'MMMM do yyyy, hh:mm:ss.SS a z', | ||
| abbreviated: 'yyyy-MM-dd HH:mm:ss a', | ||
| abbreviatedWithoutSeconds: 'yyyy-MM-dd HH:mm a', | ||
| } as const; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wondering if we should use 'full' | 'long' | 'medium' | 'short' and map to Intl.DateTimeFormat. What I don't know is if our timezone's locale map correctly.
new Intl.DateTimeFormat('en-US', {
year: 'numeric',
month: 'long',
day: 'numeric'
}).format(new Date()); // "November 17, 2025"
// Short date
new Intl.DateTimeFormat('en-US', {
year: '2-digit',
month: '2-digit',
day: '2-digit'
}).format(new Date()); // "11/17/25"
// Date + Time
new Intl.DateTimeFormat('en-US', {
dateStyle: 'short',
timeStyle: 'short'
}).format(new Date()); // "11/17/25, 2:30 PM"
Key options:
dateStyle: 'full' | 'long' | 'medium' | 'short'
timeStyle: 'full' | 'long' | 'medium' | 'short'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed. date formats now are:
11/18/25, 09:59:16.00 MST
Nov 18, 2025, 09:59:35.00 MST
November 18, 2025 at 9:59:43.00 AM MST
The short and medium formats use 24 hour clock, so PM times will be 12, 13, 14, etc. and no AM/PM indicator.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the default? Medium? Just might be weird for us 12-hour folks to have that now be 24
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, medium is the default. It was that way before, right? https://github.com/temporalio/ui/blob/main/src/lib/utilities/format-date.ts#L18
HH is 24 clock https://date-fns.org/v4.1.0/docs/format
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm good with either 24 or 12, although I think you're right that 12 might make more sense for most folks. Just was trying to keep things somewhat aligned with the previous implementation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess leaving hour12 unspecified would do it based on locale, we can do that.
Auto-generated version bump from 2.43.3 to 2.44.0 Bump type: minor Changes included: - [`d2a09d40`](d2a09d4) chore(server): optimize Docker builds with .dockerignore and improved Dockerfile (#3014) - [`0ae7ce08`](0ae7ce0) Add run Id when fetching initial values for workflow start (#3019) - [`2abd6ba0`](2abd6ba) Add route for archived event history (#3023) - [`20c692df`](20c692d) Move ziggy png under src/lib/vendor and import it (#3025) - [`0ba531d8`](0ba531d) Fix custom public path for render endpoint (#3024) - [`564dcfa9`](564dcfa) Add deprecate to pluralize. (#3026) - [`80b78303`](80b7830) DT-3307 - add custom timestamp formats (#3021) - [`be7fe154`](be7fe15) Remove timestamp from timeline axis (#3031) - [`07dec31d`](07dec31) Clear Schedule timeouts (#3030) - [`34fdd3a4`](34fdd3a) Only add link if deployment is defined (#3035) - [`d59320d1`](d59320d) If greater than 1 attempt, set actions to 0 (#3045) - [`a7629a24`](a7629a2) Bump mdast-util-to-hast from 13.2.0 to 13.2.1 (#3046) - [`37159d8f`](37159d8) Bump express from 4.20.0 to 4.22.0 (#3047) - [`4faf9843`](4faf984) feat(search-attributes): add isDeletable (#3041) - [`37a0a691`](37a0a69) Audit identity field in APIs (#3018) - [`fe84adcc`](fe84adc) update Menu and related components to runes mode (#3048) - [`378a4699`](378a469) Fix empty state png (#3053) - [`bd4dfba2`](bd4dfba) Dangerfile (#3043) - [`82a9971f`](82a9971) fix event-details-link href creation (#3055) - [`23885f39`](23885f3) Support forwarding binary headers (#3000) - [`f8b38697`](f8b3869) fix(codec-server): add spacing between action buttons (#3058) - [`4495de9a`](4495de9) Fix poller reduce logic for pollers with different identities (#3057) - [`271edd95`](271edd9) fix: update Go to 1.24.11 to fix stdlib security vulnerabilities (#3059) - [`20ab1a28`](20ab1a2) fix batch operation close time (#3060) - [`19a64bf7`](19a64bf) Add schedule link (#3061) - [`0c7597c9`](0c7597c) Change from 2 to 1 (#3062) - [`7c74da94`](7c74da9) Time range bug fix (#3050) - [`8a5b5fad`](8a5b5fa) fix(select): make Option children a required prop (#3068) - [`ce4e9a9c`](ce4e9a9) Scheduled by filter updates (#3063) - [`8faf0420`](8faf042) Update ns picker value based on page params (#3065) - [`06ca2389`](06ca238) Make custom signal first (#3069) - [`2f2adc39`](2f2adc3) fix: address security vulnerabilities in dependencies (#3056)
Auto-generated version bump from 2.43.3 to 2.44.0 Bump type: minor Changes included: - [`d2a09d40`](d2a09d4) chore(server): optimize Docker builds with .dockerignore and improved Dockerfile (#3014) - [`0ae7ce08`](0ae7ce0) Add run Id when fetching initial values for workflow start (#3019) - [`2abd6ba0`](2abd6ba) Add route for archived event history (#3023) - [`20c692df`](20c692d) Move ziggy png under src/lib/vendor and import it (#3025) - [`0ba531d8`](0ba531d) Fix custom public path for render endpoint (#3024) - [`564dcfa9`](564dcfa) Add deprecate to pluralize. (#3026) - [`80b78303`](80b7830) DT-3307 - add custom timestamp formats (#3021) - [`be7fe154`](be7fe15) Remove timestamp from timeline axis (#3031) - [`07dec31d`](07dec31) Clear Schedule timeouts (#3030) - [`34fdd3a4`](34fdd3a) Only add link if deployment is defined (#3035) - [`d59320d1`](d59320d) If greater than 1 attempt, set actions to 0 (#3045) - [`a7629a24`](a7629a2) Bump mdast-util-to-hast from 13.2.0 to 13.2.1 (#3046) - [`37159d8f`](37159d8) Bump express from 4.20.0 to 4.22.0 (#3047) - [`4faf9843`](4faf984) feat(search-attributes): add isDeletable (#3041) - [`37a0a691`](37a0a69) Audit identity field in APIs (#3018) - [`fe84adcc`](fe84adc) update Menu and related components to runes mode (#3048) - [`378a4699`](378a469) Fix empty state png (#3053) - [`bd4dfba2`](bd4dfba) Dangerfile (#3043) - [`82a9971f`](82a9971) fix event-details-link href creation (#3055) - [`23885f39`](23885f3) Support forwarding binary headers (#3000) - [`f8b38697`](f8b3869) fix(codec-server): add spacing between action buttons (#3058) - [`4495de9a`](4495de9) Fix poller reduce logic for pollers with different identities (#3057) - [`271edd95`](271edd9) fix: update Go to 1.24.11 to fix stdlib security vulnerabilities (#3059) - [`20ab1a28`](20ab1a2) fix batch operation close time (#3060) - [`19a64bf7`](19a64bf) Add schedule link (#3061) - [`0c7597c9`](0c7597c) Change from 2 to 1 (#3062) - [`7c74da94`](7c74da9) Time range bug fix (#3050) - [`8a5b5fad`](8a5b5fa) fix(select): make Option children a required prop (#3068) - [`ce4e9a9c`](ce4e9a9) Scheduled by filter updates (#3063) - [`8faf0420`](8faf042) Update ns picker value based on page params (#3065) - [`06ca2389`](06ca238) Make custom signal first (#3069) - [`2f2adc39`](2f2adc3) fix: address security vulnerabilities in dependencies (#3056) Co-authored-by: Alex-Tideman <7967403+Alex-Tideman@users.noreply.github.com>
Description & motivation 💭
<Timestamp />component to minimize direct calls toformatDateScreenshots (if applicable) 📸
Design Considerations 🎨
Testing 🧪
How was this tested 👻
Steps for others to test: 🚶🏽♂️🚶🏽♀️
Checklists
Draft Checklist
Merge Checklist
Issue(s) closed
Docs
Any docs updates needed?