function updateDayField(year, month) {
	updateDaysOfMonths(year);
	const totalDays = daysOfMonths[month - 1];
	clearList(dayField);
	console.log({ selectedDay });

	for (let i = 1; i <= totalDays; i++) {
		const option = document.createElement('option');
		option.value = i;
		option.textContent = i;

		if (i === selectedDay) option.setAttribute('selected', 'selected');
		dayField.appendChild(option);
	}
}
Update the day field on change of year and month value.
This is needed to update the day field list with the change
of the month field as the months contain different value.
It is needed to change with year as the days change with leap year as well.

@param {number} year
@param {number} month