showing results for - "sort by month name javascript"
Greyson
02 Apr 2017
1var getDaysArray = function(year, month) {
2  var names = [ 'sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat' ];
3  var date = new Date(year, month - 1, 1);
4  var result = [];
5  while (date.getMonth() == month - 1) {
6    result.push(date.getDate() + "-" + names[date.getDay()]);
7    date.setDate(date.getDate() + 1);
8  }
9  return result;
10}