Datepicker returning time

I’ve got a datepicker on my form.

<input id="ID_frm_DatePicker" name="frm_DatePicker" is="dmx-date-picker" format="YYYY-MM-DD" dmx-bind:value="form_hidden_sendingimginfotoapi.data.api_toMindee.data.document.inference.prediction.date.value" type="text">

It always returns the time as 0’s.

Is this how it’s supposed to work? Or am I doing something wrong?
My database is just expecting a date YYYY-MM-DD.

image

Yes, that is exactly the format that is supposed to be returned by the date picker.

Thanks, @Teodor.

If that’s the expected date, why does Wappler’s default validation not accept it?
Or am I doing something else wrong?

Server action…

image

Check:

I removed the client side validation; still does the same thing.

The above screen shots are from a Server action and the response I get in the browser.

Are you sure? What’s the input code?
Also change the input type to text, not date.

The input code:

This is what it looks like on the live site:

The YYYY-05-DD is just a variable I was messing with to see what happened if I formatted it like:

ID_frm_DatePicker.value.formatDate(‘YYYY-MM-DD’)

And, it definitely returns this:

image

Formatter works like:

ID_frm_DatePicker.value.formatDate('yyyy-MM-dd')

I agree with you that the date picker should return just the date and not the time when the time picker was not enabled, this is what the native html date picker also does. I will have a look if we could change this behavior and hope it doesn’t break for other users.

Here an update that you can test: dmxDatePicker.zip (2.4 KB)

1 Like

This has been fixed in Wappler 4.9.0

1 Like

This topic was automatically closed after 2 days. New replies are no longer allowed.