<?php
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

/** @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer */
/** @var \Magento\Framework\View\Element\Html\Calendar $block */

/**
 * Calendar localization script. Should be put into page header.
 *
 * @see \Magento\Framework\View\Element\Html\Calendar
 */
?>

<?php $intFirstDay = (int)$firstDay;
$scriptString = <<<script

require([
    'jquery',
], function($){

//<![CDATA[
    $.extend(true, $, {
        calendarConfig: {
            dayNames: {$days['wide']},
            dayNamesMin: {$days['abbreviated']},
            monthNames: {$months['wide']},
            monthNamesShort: {$months['abbreviated']},
            infoTitle: '{$block->escapeJs(__('About the calendar'))}',
            firstDay: {$intFirstDay},
            closeText: '{$block->escapeJs(__('Close'))}',
            currentText: '{$block->escapeJs(__('Go Today'))}',
            prevText: '{$block->escapeJs(__('Previous'))}',
            nextText: '{$block->escapeJs(__('Next'))}',
            weekHeader: '{$block->escapeJs(__('WK'))}',
            timeText: '{$block->escapeJs(__('Time'))}',
            hourText: '{$block->escapeJs(__('Hour'))}',
            minuteText: '{$block->escapeJs(__('Minute'))}',
            dateFormat: "D, d M yy", // $.datepicker.RFC_2822
            showOn: 'button',
            showAnim: '',
            changeMonth: true,
            changeYear: true,
            buttonImageOnly: null,
            buttonImage: null,
            showButtonPanel: true,
            showWeek: true,
            timeFormat: '',
            showTime: false,
            showHour: false,
            showMinute: false
        }
    });

    enUS = {$enUS}; // en_US locale reference
//]]>

});
script;
?>
<?= /* @noEscape */ $secureRenderer->renderTag('script', [], $scriptString, false) ?>
