Comparing dates in jquery

前端 未结 7 1670
鱼传尺愫
鱼传尺愫 2020-12-10 04:08

I am having the following codes and it though i\'m having 01-Jan-2009 for DateTo and 03-Jan-2009 for DateFrom it\'s readi

7条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-10 04:24

    How about this?

      DateTime DateToValue = $("#DateTo").val();
      DateTime DateFromValue = $("#DateFrom").val();
    
      if (Date.parse(DateToValue) <= Date.parse(DateFromValue)) {
          $("#DateFrom").val(DateToValue)
      }
    

提交回复
热议问题