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.
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
Simplify and centralize time formatters #1457
Simplify and centralize time formatters #1457
Changes from 1 commit
7926a28
8e1dbf9
84d61a0
1659b00
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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'd like to unify the Time Formatting as much as possible across the original LiveSplit and LiveSplit One / livesplit-core. So I'll likely apply the changes in this branch to that codebase in some form. One thing I'd somewhat like backported, which you already slightly started here, is all the other variants as well: https://github.com/LiveSplit/livesplit-core/blob/master/src/timing/formatter/digits_format.rs
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.
Ah, cool. Yeah, backporting that that could be done.
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've removed "SingleMinutes" again from
TimeFormat
and added a whole newDigitsFormat
enum which includes "SingleDigitMinutes" and everything else which is in core's. It's basically a replacement forTimeFormat
butTimeFormat
is still there there as there are too many components / settings files / etc that would need to be updated or might potentially break if it was changed to match core's enum. SoTimeFormat
is still an option for formatting, but it's marked as deprecated, and using it with GeneralTimeFormatter automatically converts over to the new core-likeDigitsFormat
.Also added Milliseconds accuracy (0.000). Also a bunch of unit tests for formatting with this new TimeAccuracy, as well as all the new
DigitsFormat
values.Also discovered I hadn't tested "AutomaticPrecision" and my implementation was broken, so copied back some original code for handling that.
Note you can choose between hours or days as the largest unit to include, but still not minutes (#1336) or seconds. Is there anything like that in core?