fix: format time to utc#1414
Conversation
There was a problem hiding this comment.
Pull request overview
This PR consolidates duplicated per-component date formatting helpers into the global resources/js/Mixins/Global.js mixin and introduces UTC-aware formatters (formatUtcDate, formatRecordTimestampUtc) so release dates render the intended calendar day regardless of viewer timezone. Components that previously defined local formatDate helpers now call the shared mixin methods, and the embargo banner plus the scheduled-release card switch to UTC formatters to avoid off-by-one day shifts.
Changes:
- Add
formatUtcDate,formatShortDate, andformatRecordTimestampUtctoGlobal.jsand add null guards to existingformatDate/formatDateTime. - Replace local per-component date formatters in
StudyCardPublic.vue,ProjectCard.vue,FileSystemBrowser.vue,Study/Files.vue, andPublic/Project/Show.vuewith the global helpers. - Use UTC formatters in
Public/Project/Layout.vue(embargo banner) andProject/Index.vue(scheduled release card).
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| resources/js/Mixins/Global.js | Adds new UTC and short-date helpers; adds null guards to existing helpers. |
| resources/js/Shared/StudyCardPublic.vue | Removes local formatDate; relies on global mixin. |
| resources/js/Shared/ProjectCard.vue | Switches template calls to formatShortDate and drops local helper. |
| resources/js/Shared/FileSystemBrowser.vue | Uses formatRecordTimestamp for file rows; removes local formatDate. |
| resources/js/Pages/Study/Files.vue | Same swap to formatRecordTimestamp and helper removal. |
| resources/js/Pages/Public/Project/Show.vue | Uses formatShortDate for published/created dates; removes local helper. |
| resources/js/Pages/Public/Project/Layout.vue | Embargo banner uses formatUtcDate; removes local helper. |
| resources/js/Pages/Project/Index.vue | Scheduled release card uses formatRecordTimestampUtc. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## development #1414 +/- ##
==================================================
+ Coverage 56.63% 75.45% +18.81%
- Complexity 2268 3331 +1063
==================================================
Files 207 234 +27
Lines 8733 12477 +3744
==================================================
+ Hits 4946 9414 +4468
+ Misses 3787 3063 -724
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
No description provided.