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

Fix QuantityType dimensionless one and time formatting #4169

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mherwege
Copy link
Contributor

@mherwege mherwege commented Apr 4, 2024

Resolves #4166
Resolves #4163

This PR tries to resolve two issues with QuantityType:

  1. Updating a Number:Dimensionless Item with a value of unit one, when the unit is set in metadata to another unit, will not update correctly. The proposed solution is to remove the special handling of unit one and make the unit part of the string again. It can be removed from visualisation using a state description.
  2. Formatting a QuantityType tries to use the DateTime String formatting methods. When it fails it may output a UTC date. Durations will also not be correctly formatted when days/hours/minutes/seconds are above the month (31)/day (24)/hour (60)/minute (60) limits. In this PR, the formatting strings are preserved, but interpreted specifically for time with a relative scale (durations), rather than an absolute time.

Signed-off-by: Mark Herwege <mark.herwege@telenet.be>
Copy link
Contributor

@andrewfg andrewfg left a comment

Choose a reason for hiding this comment

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

LGTM thankyou.

@andrewfg
Copy link
Contributor

andrewfg commented Apr 5, 2024

@mherwege many thanks. I like the extra bonus for the duration formatting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants