Page 1 of 2

Built in Bryntum DateField validation

Posted: Wed Mar 08, 2023 12:31 am
by tanyarb

Hi

We are using the DateField widget as a component.

Currently it is possible to enter a date of 55/27/2023 and not get any invalid date message (as it fulfills the date format, presumably). When we try to check and parse the value ourselves onAction, the value does not appear to be an incorrect date as it has been changed through the built in Bryntum validation to a valid (but unintended) date (in this example, it was changed to 24/04/2025).

What is the best way to amend / add our own validation on top of the built-in Bryntum date validation that occurs on input to fix this type of issue?

Thanks.

<BryntumDateField
      :width="150"
      :height="30"
      :format="'DD/MM/YYYY"
      :value="newDate"
      :strict-parsing="true"
      @action="newDate = $event.value"
    />

Re: Built in Bryntum DateField validation

Posted: Wed Mar 08, 2023 8:01 am
by tasnim

Thanks for your report. I've reproduced it. We'll investigate it. Here is the ticket to track progress https://github.com/bryntum/support/issues/6321

Good Luck :),
Tasnim


Re: Built in Bryntum DateField validation

Posted: Wed Mar 08, 2023 11:43 am
by tanyarb

Thanks Tasnim. Please can you also confirm whether it is possible to supply two (or further additional) date formats for parsing the date? I can see in the source there is a fallbackFormat option that is tried after the format, but when I try to pass that value in the component it does not change anything as I don't think it's part of the editable config.

The problem that is occurring is that if the date cannot be parsed using the format (e.g. DD/MM/YYYY, but the user enters DD/MM/YY) the date is parsed in U.S. time (i.e. it makes it MM/DD/YYYY) through the built in validation (before we get a chance to validate ourselves onAction).


Re: Built in Bryntum DateField validation

Posted: Wed Mar 08, 2023 12:21 pm
by tasnim

Hi,
Yes. One of our team members added a comment to make the parser flexible https://github.com/bryntum/support/issues/6321#issuecomment-1459611562


Re: Built in Bryntum DateField validation

Posted: Wed Mar 08, 2023 12:34 pm
by tanyarb

Thanks - the approach in the comment would be very helpful to avoid a wide range of validation errors


Re: Built in Bryntum DateField validation

Posted: Tue Mar 21, 2023 1:13 pm
by tanyarb

Hi - just following up on this. Do we know when this might be resolved?


Re: Built in Bryntum DateField validation

Posted: Tue Mar 21, 2023 1:42 pm
by alex.l

Hi,

There is no milestone set yet, so this means in won't be resolved in nearest releases, so I cannot provide any estimations now, we need to wait a bit when project management will assign a milestone.
You can subscribe on ticket updates to be notified when status is changed.


Re: Built in Bryntum DateField validation

Posted: Fri Mar 24, 2023 11:03 pm
by tanyarb

Thanks. I understand it's now going to be deal with in the next release. I have also noticed that when I try to supply validateOnInput when using the DateField as a component, this does not seem to work. It continues to validate on input and when debugging, the DateField attrs have 'true' for validateOnInput.

<BryntumDateField
      :width="180"
      :height="30"
      :format="DEFAULT_DATE_FORMAT"
      :value="endDate"
      placeholder="Ends"
      :step="stepEnd"
      :validate-on-input="false"
      :strict-parsing="false"
      @action="endDate = $event.value"
    />

Re: Built in Bryntum DateField validation

Posted: Sat Mar 25, 2023 9:24 pm
by alex.l

Hi,

I can't find if you mentioned what framework do you use? Vue?
Try to use validateOnInput name instead of validate-on-input.


Re: Built in Bryntum DateField validation

Posted: Mon Mar 27, 2023 7:17 pm
by tanyarb

Hi Alex - it is Vue. Vue requires hyphenation for the component attributes