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

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

/** @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer */

$scriptString = '
require([
    "jquery",
    "jquery/ui"
], function($){

    $.extend(true, $, {
        calendarConfig: {
            dayNames: ' .  /* @noEscape */ $days['wide'] . ',
            dayNamesMin: ' . /* @noEscape */ $days['abbreviated'] . ',
            monthNames: ' . /* @noEscape */ $months['wide'] . ',
            monthNamesShort: ' . /* @noEscape */ $months['abbreviated'] . ',
            infoTitle: "' . $block->escapeJs(__('About the calendar')) . '",
            firstDay: ' . /* @noEscape */ $firstDay . ',
            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: $.datepicker.RFC_2822,
            showOn: "button",
            showAnim: "",
            changeMonth: true,
            changeYear: true,
            buttonImageOnly: null,
            buttonImage: null,
            showButtonPanel: true,
            showOtherMonths: true,
            showWeek: false,
            timeFormat: \'\',
            showTime: false,
            showHour: false,
            showMinute: false,
            serverTimezoneSeconds: ' . (int) $block->getStoreTimestamp() . ',
            serverTimezoneOffset: ' . (int) $block->getTimezoneOffsetSeconds() . ',
            yearRange: \'' . $block->escapeJs($block->getYearRange()) . '\'
        }
    });

enUS = ' . /* @noEscape */ $enUS . '; // en_US locale reference

});';

echo /* @noEscape */ $secureRenderer->renderTag('script', [], $scriptString, false);
