PageSourceSearch

https://atlantisbeach.gr/wp-content/themes/hotello/public/js/vc_modules/wp_hotelier_form/datepicker.js?ver=1.0

js atlantisbeach.gr collected 2026-10-08 20:25:13 UTC 4,298 bytes, 108 lines download raw bytes

1'use strict';
2
3var picker;
4
5jQuery(function ($) {
6    'use strict';
7
8
9    if (typeof datepicker_params === 'undefined') {
10        return false;
11    }
12
13    function get_data() {
14        if (document.getElementById('hotelier-datepicker-select')) {
15            var checkin_val = '';
16            var checkout_val = '';
17
18            $.ajax({
19                url: datepicker_params.htl_ajax_url.toString(),
20                type: 'POST',
21                success: function success(response) {
22                    if (response) {
23                        checkin_val = response.checkin.toString();
24                        checkout_val = response.checkout.toString();
25
26                        init_datepicker(checkin_val, checkout_val);
27                    }
28                }
29            });
30        }
31    }
32
33    function init_datepicker(checkin, checkout) {
34        if (document.getElementById('hotelier-datepicker-select')) {
35            var date_select_input = $('#hotelier-datepicker-select');
36            var checkin_input = $('#hotelier-datepicker-checkin');
37            var checkout_input = $('#hotelier-datepicker-checkout');
38
39            date_select_input.show();
40            checkin_input.hide();
41            checkout_input.hide();
42
43            if (checkin && checkout) {
44                checkin_input.val(checkin);
45                checkout_input.val(checkout);
46
47                var checkin_date = new Date(checkin.replace(/-/g, '\/'));
48                var checkout_date = new Date(checkout.replace(/-/g, '\/'));
49                var checkin_date_formatted = fecha.format(checkin_date, datepicker_params.datepicker_format);
50                var checkout_date_formatted = fecha.format(checkout_date, datepicker_params.datepicker_format);
51
52                date_select_input.val(checkin_date_formatted + ' - ' + checkout_date_formatted);
53                hotello_set_checkin_values(checkin_date_formatted, checkout_date_formatted);
54            }
55
56            picker = new HotelDatepicker(document.getElementById('hotelier-datepicker-select'), {
57                infoFormat: datepicker_params.datepicker_format,
58                startOfWeek: datepicker_params.start_of_week,
59                startDate: datepicker_params.start_date,
60                endDate: datepicker_params.end_date,
61                minNights: parseInt(datepicker_params.min_nights, 10),
62                maxNights: parseInt(datepicker_params.max_nights, 10),
63                disabledDates: datepicker_params.disabled_dates,
64                enableCheckout: datepicker_params.enable_checkout,
65                disabledDaysOfWeek: datepicker_params.disabled_days_of_week,
66                autoClose: false,
67                i18n: datepicker_params.i18n,
68                getValue: function getValue() {
69                    if (checkin_input.val() && checkout_input.val()) {
70                        return checkin_input.val() + ' - ' + checkout_input.val();
71                    }
72                    return '';
73                },
74                setValue: function setValue(s, s1, s2) {
75                    var checkin_date = new Date(s1.replace(/-/g, '\/'));
76                    var checkout_date = new Date(s2.replace(/-/g, '\/'));
77                    var checkin_date_formatted = fecha.format(checkin_date, datepicker_params.datepicker_format);
78                    var checkout_date_formatted = fecha.format(checkout_date, datepicker_params.datepicker_format);
79
80                    date_select_input.val(checkin_date_formatted + ' - ' + checkout_date_formatted);
81                    checkin_input.val(s1);
82                    checkout_input.val(s2);
83
84                    hotello_set_checkin_values(checkin_date_formatted, checkout_date_formatted);
85                }
86            });
87
88            $('.form-group-label').on('click', function () {
89                setTimeout(function () {
90                    picker.open();
91                }, 10);
92            });
93        }
94    }
95
96    $(document).ready(function () {
97        get_data();
98    });
99
100    $(window).on('load', function () {
101        get_data();
102    });
103});
104
105function hotello_set_checkin_values(checkin_date_formatted, checkout_date_formatted) {
106    jQuery('.form-group-label.checkin').text(checkin_date_formatted);
107    jQuery('.form-group-label.checkout').text(checkout_date_formatted);
108}

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.