PageSourceSearch

https://mcctheater.org/plugins/attendable/app/datepicker.js?ver=1.0.0

js mcctheater.org collected 2026-10-02 05:46:06 UTC 1,994 bytes, 73 lines download raw bytes

1jQuery(function($) {
2
3    /**
4     *
5     */
6    var pad = function(n, width, z) {
7        z = z || '0';
8        n = n + '';
9        return n.length >= width ? n : new Array(width - n.length + 1).join(z) + n;
10    }
11
12    /**
13     *
14     */
15    var instancesTooltip = function(instances)
16    {
17        var instance, titles = [];
18
19        for (var i = 0; i < instances.length; i++) {
20            instance = instances[i];
21            titles.push(instance.post_title);
22        }
23
24        return titles.join('\n');
25    }
26
27    /**
28     *
29     */
30    var instanceOnDay = function (date)
31    {
32        var day    = pad(date.getDate(), 2);
33        var month  = pad(date.getMonth() + 1, 2);
34        var year   = date.getFullYear();
35        var string = '' + year + month + day;
36
37        if (typeof window.attendable.instances[string] !== 'undefined') {
38            return window.attendable.instances[string];
39        }
40
41        return [];
42    };
43
44    /**
45     *
46     */
47    $('.attendable-datepicker').datepicker({
48        dateFormat:        'yy/mm/dd',
49        changeMonth:       window.attendable.datepicker.changeMonth,
50        changeYear:        window.attendable.datepicker.changeYear,
51        minDate:           window.attendable.datepicker.minDate,
52        maxDate:           window.attendable.datepicker.maxDate,
53        showButtonPanel:   window.attendable.datepicker.showButtonPanel,
54        showOtherMonths:   window.attendable.datepicker.showOtherMonths,
55        selectOtherMonths: window.attendable.datepicker.selectOtherMonths,
56
57        onSelect: function(date) {
58            window.location = window.attendable.whatsOnURL + date;
59        },
60
61        beforeShowDay: function(date) {
62            var instances = instanceOnDay(new Date(date))
63
64            if (instances.length > 0) {
65                return [true, 'active', instancesTooltip(instances)];
66            }
67
68            return [false, 'inactive', false];
69        }
70
71    }).datepicker('setDate', window.attendable.currentDate);
72
73});

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.