[JavaScript] 두 날짜간의 날수 리턴

Posted by MD워시퍼
2011. 1. 19. 17:09 Study
728x90
function getDaysBetweenBothDate(s_date, e_date) {
  s_date = removeFmt(s_date);
  e_date = removeFmt(e_date);
  if (s_date != "" && e_date != "") {
    if( parseFloat(s_date) <= parseFloat(e_date)) {
      daysS_date = calculate_total_days(s_date);
      daysE_date = calculate_total_days(e_date);

      days = daysE_date - daysS_date;
      return days;
    }
  }
  return "-1" ;
}