jquery 比较两个日期的大小

js

  $("#Text2").click(function ()
            {
                WdatePicker({ dateFmt: 'yyyy-MM-dd HH:mm' });
            });

            $("#Text3").click(function ()
            {
                WdatePicker({ dateFmt: 'yyyy-MM-dd HH:mm' });
            });

            $("#Button3").click(function ()
            {
                var ks = $("#Text2").val();
                var start = new Date(ks.replace("-", "/").replace("-", "/"));
                var js = $("#Text3").val();
                var end = new Date(js.replace("-", "/").replace("-", "/"));
                if (end < start)
                {
                    $("#dvsj").html("Js小");
                }
                else
                {
                    $("#dvsj").html("开始小");
                }
            });

 

html

   checkdate<br />
    KS<input id="Text2" type="text" />
    JS<input id="Text3" type="text" />
    <input id="Button3" type="button" value="sj" />
    <div id="dvsj"></div>

你可能感兴趣的:(jquery 比较两个日期的大小)