DateBox jQuery Mobile - min-attribute set after page load. enddate not allowed before startdate

StackOverflow https://stackoverflow.com/questions/19335605

  •  30-06-2022
  •  | 
  •  

I want to ensure, that people can not choose an end date that is earlier than the start date in this fiddle: http://jsfiddle.net/pUQhA/3/

I have tried to set the min attribute to the date, when I update start date, but it will not work. I have tried to refresh, but it will still not work. What can I do?

$("#end_date").attr("min", $("#start_date").val());
$("#end_date").trigger("datebox", {"method":"dorefresh"});

When I do this, it sets the min-attr but I can still choose an date before the start date.

有帮助吗?

解决方案

I found the solution:

$('element').datebox('applyMinMax')

And the date format for min must be %Y-%m-%d and not %d-%m-%Y as I had at first!

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top