Closed erikbrinkman closed 6 years ago
Thank you for the contribution. There is a small problem with this branch. When I enter 2 then the timer is started with 3 minutes. This is caused through the TimeSpan.from_glib constructor. There a minute is added and since you now also call it in in the parsing step 2 minutes are added. The adding is needed in the TimeObject.update method otherwise the timer e.g. finishes at 1 minute and so on.
Can you also allow "," as decimal seperator.
Thanks for the catch. I'm not sure how I missed it. That's what I get for not really looking at from_glib. These should both be fixed.
Thank you. Works great.
This PR consists of two important changes
long
regex to parse the string once and find all day/minutes/hours/seconds, and enforced a strict match, i.e. currentlygibberish 5
gets interpreted as5 minutes
, but this seems like undesired behavior.TimeSpan
accordingly, so3.5
is now interpreted "correctly" as3 minutes 30 seconds
instead of5
seconds (the3.
is ignored as an unmatched prefix).