Standardize time & duration formatting with Settings toggle - #33
Merged
Conversation
Clock times always use h:mm am/pm. Durations default to compact "5h 6m"
with a Settings toggle for decimal hours ("5.1h"), using up to two
decimals for quarter-hour sleep goals.
Co-authored-by: Greg <gsbernstein@users.noreply.github.com>
Unequal Average/Goal string widths were shifting Status off-center; give each column maxWidth infinity so the middle stays centered. Co-authored-by: Greg <gsbernstein@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Makes clock times and durations consistent across Bedger.
h:mm am/pm(e.g.11:10 PM) via a sharedTimeFormatter.formatTimeOfDay.5h 6m), with a Settings → Display toggle for decimal hours (5.1h).7.25h,8.5h,8h); other durations stay at one decimal (5.1h).6h 35mvs7h).Details
DurationDisplayStyle+useDecimalDurationspreference onUserPreferences, exposed through a SwiftUI environment value.H:MMduration helper and scattered%.1f hours/ locale.shorttime formatters.2 hours 30 minutes) since they read as prose.Verification
Cannot build or run in this Linux Cloud Agent environment (Xcode / SwiftUI / HealthKit are macOS-only). Please verify on a Mac with the Bedtime scheme.