Miwa
September 10, 2020, 2:26am
1
Hello,
Current time is Sep 10th, 2020 11:25 AM in my region.
but the validation error shows up like this.
By the way, I set date input as below (I’m not using datepicker here because there are other issues)
<input name="entrystartdate" type="date" id="entrystartdate" required="required" dmx-bind:min="var1.datetime">
The validation error should not show up, because currenttime < Sep 11th definitly.
How can I solve this?
sid
September 10, 2020, 10:09am
2
Miwa
September 10, 2020, 10:56am
3
Thank you, I added it but still not working.
sid
September 10, 2020, 11:02am
4
Sorry… missed the part about it being a date-time comparision.
Here is an updated version of the DMX Formatter to handle both date & datetime-local types:
dmx.rules.max.validity = function (element, param) {
if (element.type == 'date' || element.type == 'datetime-local') {
return element.value <= param;
}
return +element.value <= param;
};
dmx.rules.min.validity = function (element, param) {
if (element.type == 'date' || element.type == 'datetime-local') {
return element.value >= param;
}
return +element.value >= param;
};
Miwa
September 10, 2020, 11:05am
5
Thanks a lot,
I added this one after dmxdatevalidator.js part.
sid:
dmx.rules.max.validity = function (element, param) {
if (element.type == 'date' || element.type == 'datetime-local') {
return element.value <= param;
}
return +element.value <= param;
};
dmx.rules.min.validity = function (element, param) {
if (element.type == 'date' || element.type == 'datetime-local') {
return element.value >= param;
}
return +element.value >= param;
};
but it is not working yet...
sid
September 10, 2020, 11:11am
6
Are the time & date two separate fields?
If not, have you tested by setting the time value too?
Miwa
September 10, 2020, 11:14am
7
I have another problem with single field of date and time now
I have a similar issue now.
Two calendars pop up and I can’t even pick the date on both calendars…
so I would like to use them as they are...
sid
September 10, 2020, 11:24am
8
The post is about validation not showing up correctly from the server side to client side. I don’t have any such configuration right now to test this.
But, I did try to test your issue of “two” pickers. I could not replicate it. Simple date picker is working fine.
Miwa
September 10, 2020, 11:32am
9
Please have a look at this. two calendars for one input show up…
sid
September 10, 2020, 12:05pm
10
I see that you have set the “type” property to “date” or “datetime-local”. Which is why you are seeing the browser date picker, as well as Wappler’s. Just remove the type property from the input and try.
You can use only 1 of the two.
As for validation, you have to set the min/max date values using the “dynamic events > date picker” options.
Miwa
September 10, 2020, 12:42pm
11
I could make only one calendar show up. But I can’t pick a date on the calendar, the input data disappears even if I pick some…
I could set min date on dynamic attribute > date picker. Thanks
sid
September 10, 2020, 12:44pm
12
Are you doing something else on the date picker input field? Some click event or some other JS stuff?
Can you share the code or a link to the page would be better.
I am not seeing any issue with selecting a date using Wappler’s date picker.
Miwa
September 10, 2020, 12:48pm
13
It seems quite simple though…
please have a loot at this
<input is="dmx-date-picker" dmx-bind:mindate="var1.datetime">
sid
September 10, 2020, 12:55pm
14
<input id="date1" name="date1" is="dmx-date-picker">
This is what I get when I add a new date picker. Please try adding an ID & NAME to your code.
1 Like
Miwa
September 10, 2020, 12:59pm
15
<input is="dmx-date-picker" dmx-bind:mindate="var1.datetime" id="entrystart" name="entrystart">
now it worked!!! thanks a lot for taking your time!!!
1 Like