Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to get current week start and end date from dashboard
#1
var date = new Date();
var currentWeekDay = date.getDay();
var lessDays = currentWeekDay == 0 ? 6 : currentWeekDay-1;

var weekkStart = new Date(new Date(date).setDate(date.getDate()- lessDays));
var weekkEnd = new Date(new Date(wkStart).setDate(wkStart.getDate()+6));
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)