开发者

jquery two different date validation

开发者 https://www.devze.com 2022-12-30 18:22 出处:网络
var cin = $开发者_开发百科(\"#datepicker\").val(); var cout = $(\"#datepicker2\").val(); dateformat is : dateFormat: \'DD, d MM, yy\'

var cin = $开发者_开发百科("#datepicker").val(); var cout = $("#datepicker2").val(); dateformat is : dateFormat: 'DD, d MM, yy'

how do i use jquery to check cin(checkin) date not past cout(checkout) date? which means, cout date cannot earlier then cin date


I don't know what your datepicker is, but if it is a JQuery-datepicker, then better get the date with .datepicker("getDate"). Then, you should have JS Date objects, that you can compare like normal numbers (see http://www.w3schools.com/js/js_obj_date.asp)

0

精彩评论

暂无评论...
验证码 换一张
取 消