Loading...
Important Notice - Forums is archived

To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Product icon
TUTORIAL

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.

How to override date validation client side

Lino Costa
6 years ago May 18, 2015 1:55pm
Vesa Tuononen
6 years ago May 18, 2015 8:39pm

In server side it is quite easy to do this kinds of parsing manipulations.
Why you want to do it in browser?

DateField df = new DateField() {

      @Override
      protected Date handleUnparsableDateString(final String dateString)
          throws Converter.ConversionException {
        if("today".equals(dateString)){
          return new Date();
        }
        throw new Converter.ConversionException("UNABLE PARSE DATE");
      }
    };
Lino Costa
6 years ago May 19, 2015 5:22am