/**
* 오늘 날짜 반환
*/
function getToday() {
var a = new Date();
return a;
}
/**
* 이달의 마지막 일 반환
*/
function getMonthEndDate(year, month) {
var dt = new Date(year, month, 0);
return dt.getDate();
}
/**
* 이번주 일~토 날짜 반환
*/
function getWeekDate() {
var currentDay = new Date();
var theYear = currentDay.getFullYear();
var theMonth = currentDay.getMonth();
var theDate = currentDay.getDate();
var theDayOfWeek = currentDay.getDay();
var thisWeek = [];
for(var i=0; i<7; i++) {
var resultDay = new Date(theYear, theMonth, theDate + (i - theDayOfWeek));
var yyyy = resultDay.getFullYear();
var mm = Number(resultDay.getMonth()) + 1;
var dd = resultDay.getDate();
mm = String(mm).length === 1 ? '0' + mm : mm;
dd = String(dd).length === 1 ? '0' + dd : dd;
thisWeek[i] = yyyy + '-' + mm + '-' + dd;
}
return thisWeek;
}