Page 1 of 1

How can we handle both comma and dot as decimal separator in effort column ?

Posted: Wed Feb 24, 2021 5:40 pm
by beotech

Let's assume the user's locale has the dot as decimal separator.

  • If the user enters 2.4 in the effort column, it will be correctly displayed as 2.4 after validation

  • If the user enters 2,4 in the effort column, it will be automatically converted to 2, instead of 2.4

We would like to be able to manage both the coma and the dot separators.

Is there a way to achieve that ?
If not, is there an event we can use to perform a replace coma with dot on the entered value before it is converted ?


Re: How can we handle both comma and dot as decimal separator in effort column ?

Posted: Wed Feb 24, 2021 6:59 pm
by pmiklashevich

Thank you for the report, ticket here: https://github.com/bryntum/support/issues/2460


Re: How can we handle both comma and dot as decimal separator in effort column ?

Posted: Thu Feb 25, 2021 10:01 am
by beotech

As we are not going to upgrade our Bryntum Gantt version anytime soon, could you provide us with a alternative temporary solution please ?


Re: How can we handle both comma and dot as decimal separator in effort column ?

Posted: Thu Feb 25, 2021 10:08 am
by pmiklashevich

You can override DateHelper.parseDuration function to replace comma with dot in the first match

magnitude = parseNumber(match[1]?.replace(',', '.')),