PageSourceSearch

https://pink-floyds.ru/.s/src/calendarUtil.js

js pink-floyds.ru collected 2026-10-02 19:31:24 UTC 1,615 bytes, 33 lines download raw bytes

1var calendarUtil = {
2	// Возвращает количество дней в месяце по конкретному году
3	getDaysInMonth: function(m, y ) {
4		var days = [31, (y % 4 == 0 && y % 100 != 0 || y % 400 == 0) ? 29:28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 ];
5		return days[m - 1];
6	},
7
8	displayAvailableDays: function(daySelector, monthSelector, yearSelector ) {
9		var dayNum   = document.querySelector('select' + daySelector)   && +document.querySelector('select' + daySelector).value;
10		var monthNum = document.querySelector('select' + monthSelector) && +document.querySelector('select' + monthSelector).value;
11		var yearNum  = document.querySelector('select' + yearSelector)  && +document.querySelector('select' + yearSelector).value;
12		if (monthNum && yearNum ) {
13			var days_in_month = this.getDaysInMonth(monthNum, yearNum );
14			var diff = $(daySelector + ' option').length - 32;
15			var indx = days_in_month + diff;
16			$(daySelector + ' option').slice(0, indx + 1).removeClass('hidden-for-calendar');
17			$(daySelector + ' option').slice(indx + 1).addClass('hidden-for-calendar');
18			if (dayNum > days_in_month ) {
19				$(daySelector).val(days_in_month);
20			}
21		} else {
22			$('option', daySelector).slice(0, indx).removeClass('hidden-for-calendar');
23		}
24	},
25
26	setAvailableDays: function(daySelector, monthSelector, yearSelector ) {
27		var $this = this;
28		$this.displayAvailableDays(daySelector, monthSelector, yearSelector );
29		$('select').filter(monthSelector +', '+ yearSelector).on('change', function() {
30			$this.displayAvailableDays(daySelector, monthSelector, yearSelector );
31		});
32	}
33}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.