Skip to content
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

bgclock 24h fix #4162

Merged
merged 5 commits into from
Feb 2, 2019
Merged

bgclock 24h fix #4162

merged 5 commits into from
Feb 2, 2019

Conversation

unsoluble
Copy link
Contributor

Clock display code was generating "24:xx" instead of "00:xx". Fixed, and also ensured 12-hour time would still do "12:xx".

@@ -124,7 +124,13 @@
// Generate and insert the clock.
var timeDivisor = (window.serverSettings.settings.timeFormat) ? window.serverSettings.settings.timeFormat : 12;
var today = new Date(),
h = today.getHours() % timeDivisor || timeDivisor,
h = today.getHours() % timeDivisor;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer to do the time formatting in the same way within Nightscout and use a formatting function instead of doing the formatting inline.

In the frontend we use a rather outdated version of the d3 library, see

.text(formatTime(nowDate, true))

I don't mind switching to moment javascript for both basic viewing of the time and the bgclock function. See e.g.

http://momentjs.com/docs/#/parsing/string-format/
https://stackoverflow.com/questions/12970284/moment-js-24h-format

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure. I'm going to need guidance on how to properly include a library like that; not clear on the broad implications.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we get this one into .11 and then do the clock rebuilds alongside the other view changes we've got slated for .12?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clock refactoring should be part of 0.12, in order to make it work similar to the normal frontend

@PieterGit
Copy link
Contributor

Merging for now for 0.11. bigger clock refactors should be done in Nightscout 0.12

@PieterGit PieterGit merged commit 2260fb4 into nightscout:dev Feb 2, 2019
@PieterGit PieterGit added this to the 0.11.0 milestone Feb 2, 2019
@unsoluble unsoluble deleted the bgclock-24h-fix branch February 2, 2019 21:40
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.

3 participants