I am trying to make a function that can check if a given date is in a specified week ago.
For example, if the input is <1, date object>
, then it asks, if the given date is from last week. If the input is <2, date object>
, then it asks if the given date is from 2 weeks ago, etc.. (0 is for current week).
Week is Sun-Sat.
this.isOnSpecifiedWeekAgo = function(weeks_ago, inputDate) {
return false;
};
But I don't want to use any libraries, and also I am not sure how to change the week of a date object. Does anyone know how to begin?
Thanks