if you need to get the difference between two dates in days. you can use this function :

   dayDiff(d1:Date, d2:Date)
  {
    var diff = Math.abs(date1.getTime() - date2.getTime());
    var diffDays = Math.ceil(diff / (1000 * 3600 * 24)); 
    return diffDays;
  }

if you are using the date as a String you can have this error getTime() is not a function ! so if you have this error try this solution

Laisser un commentaire