Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

print all days names of a month

function getDayNamesInMonth(month, year) {
  let date = new Date(year, month, 1);
  let days = [];
  while (date.getMonth() === month) {
    days.push(new Date(date).toLocaleDateString('en-US', { weekday: 'short' }));
    date.setDate(date.getDate() + 1);
  }
  return dayNames;
}
 
PREVIOUS NEXT
Tagged: #print #days #names #month
ADD COMMENT
Topic
Name
1+5 =