timetracker icon indicating copy to clipboard operation
timetracker copied to clipboard

Enable ',' input to the duration field

Open LevRiver opened this issue 4 years ago • 1 comments

It would be great, if the input field (german: Dauer:) would accept ',' as a decimals spearator, too.

LevRiver avatar Aug 24 '21 07:08 LevRiver

It already handles it, just tested on the latest version. Am I missing something?

Here is a comment in postedDurationToMinutes that does the checking:

// postedDurationToMinutes - converts a value representing a duration // (usually entered in a form by a user) to an integer number of minutes. // // Parameters: // $duration - user entered duration string. Valid strings are: // 3 or 3h - means 3 hours. Note: h and m letters are not localized. // 0.25 or 0.25h or .25 or .25h - means a quarter of hour. // 0,25 or 0,25h or ,25 or ,25h - same as above for users with comma as decimal mark. // 1:30 - means 1 hour 30 minutes. // 25m - means 25 minutes. // $max - maximum number of minutes that is valid.

anuko avatar Sep 01 '21 14:09 anuko

This is indeed implemented:

  • https://github.com/anuko/timetracker/blob/master/WEB-INF/lib/ttTimeHelper.class.php#L111
  • https://github.com/anuko/timetracker/blob/master/WEB-INF/lib/ttTimeHelper.class.php#L163C1-L167C57

The decimal mark can be set for a group on /group_edit.php as . or ,.

ram-fabian-heinrich avatar Sep 07 '23 15:09 ram-fabian-heinrich

Closing, as the requested feature is already supported.

anuko avatar Sep 08 '23 16:09 anuko