const update = () => {
	let request = new XMLHttpRequest();
	if (selected_cal_type == "daily") {
		request.open('GET', "/calendar/admin/day/" + selected_date.format('YYYY-MM-DD'), true);
		request.onload = () => { day_onload(request) };
	}
	else if (selected_cal_type == "monthly") {
		request.open('GET', "/calendar/admin/month/" + selected_date.format('YYYY-MM'), true);
		request.onload = () => { month_onload(request) };
	}
	request.send();
	//update_timeout = setTimeout(update, 60000);
}

init_times(selected_date);
init_event_listeners();
update();
//listen();