반응형
var toDate = new Date($("#toDate").val());
var fromDate = new Date($("#fromDate").val());
var dateGap = Math.ceil(
      (toDate.getTime() - fromDate.getTime()) / (1000 * 3600 * 24)
    );

ex)

fromDate : 2021-04-30

toDate : 2021-05-01

dateGap : 1 

 

반응형

+ Recent posts