mirror of
https://github.com/abh/ntppool.git
synced 2026-04-25 19:45:50 +03:00
[PR #254] Fix 12-hour time format issue in graphs by implementing custom 24-hour formatter #822
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/ntppool#822
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/abh/ntppool/pull/254
Author: @Copilot
Created: 6/4/2025
Status: 🔄 Open
Base:
main← Head:copilot/fix-216📝 Commits (4)
1e6ed4cInitial plan for issueededda3Fix 12-hour time format issue in graphs by implementing custom 24-hour formatter3da5c13Update time formatter to ES5-compatible syntax for older browser supportdcb9ae2Merge main branch and apply 24-hour time fix to TypeScript zone-chart📊 Changes
1 file changed (+23 additions, -1 deletions)
View changed files
📝
client/src/charts/zone-chart.ts(+23 -1)📄 Description
This PR fixes the confusing time display issue in graphs where minutes were shown in 12-hour format without AM/PM indicators, while hours were correctly displayed in 24-hour format.
Problem
The issue occurred when D3.js default
tickFormat()method mixed 12-hour and 24-hour time formats, creating confusing sequences like:Solution
Implemented a custom 24-hour time formatter that replaces D3's default
tickFormat()inclient/src/charts/zone-chart.ts:server-chart.tsalready used explicitd3.utcFormat('%H:%M')specifiers via itscreateDateFormatterfunction.Result
Time displays are now consistent with 24-hour format throughout:
Changes
client/src/charts/zone-chart.ts— Addedformat24HourDate()helper and replacedxScale.tickFormat()call with itTesting
🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.