Skip to content

Round schedule time to nearest minute - #13988

Open
mlozturk wants to merge 1 commit into
linuxmint:masterfrom
mlozturk:nightlight-round-schedule-time
Open

Round schedule time to nearest minute#13988
mlozturk wants to merge 1 commit into
linuxmint:masterfrom
mlozturk:nightlight-round-schedule-time

Conversation

@mlozturk

Copy link
Copy Markdown

Night Light schedule times are stored as hour fractions.
Converting back with int((fraction - hours) * 60) truncated floating point leftovers, so 11:38 could display as 11:37.

Convert to total minutes, round(), then split with divmod. This is more correct and cleaner, and keeps the displayed time in sync with 3rd party tools that write the same GSettings keys.

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.

1 participant