{**
* 2007-2021 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
*  @author PrestaShop SA <contact@prestashop.com>
*  @copyright  2007-2021 PrestaShop SA
*  @license    http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
*  International Registered Trademark & Property of PrestaShop SA
*}
<script type="text/javascript">
    var wdpc_psv = {$psv|floatval};
    var wdpc_ajax_url = "{$ajax_url|escape:'quotes':'UTF-8'}";
    var wdpc_remove_confirm_txt = "{l s='Are you sure you want to delete this countdown?' mod='wdproductcountdown'}";
    var wdpc_basic_confirm_txt = "{l s='Are you sure?' mod='wdproductcountdown'}";
    var wdpc_flatpickr = false;

    $(document).on('focus', '.wdpc-datepicker', function () {
        if (!$(this).hasClass('flatpickr-input')) {
            wdpc_loadDatetimepicker();
        }
    });

    function wdpc_loadDatetimepicker() {
        if (typeof wdpc_flatpickr === 'object' && typeof wdpc_flatpickr.destroy === 'function') {
            wdpc_flatpickr.destroy();
        }

        {literal}
        wdpc_flatpickr = flatpickr('.wdpc-datepicker', {
            enableTime: true,
            time_24hr: true,
            dateFormat: 'Z',
            altInput: true,
            altFormat: 'Y-m-d H:i',
            disableMobile: true,
            locale: {
                weekdays: {
                    {/literal}shorthand: ['{l s='Su.' mod='wdproductcountdown'}', '{l s='Mo.' mod='wdproductcountdown'}', '{l s='Tu.' mod='wdproductcountdown'}', '{l s='We.' mod='wdproductcountdown'}', '{l s='Th.' mod='wdproductcountdown'}', '{l s='Fr.' mod='wdproductcountdown'}', '{l s='Sa.' mod='wdproductcountdown'}'],
                    longhand: ['{l s='Sunday' mod='wdproductcountdown'}', '{l s='Monday' mod='wdproductcountdown'}', '{l s='Tuesday' mod='wdproductcountdown'}', '{l s='Wednesday' mod='wdproductcountdown'}', '{l s='Thursday' mod='wdproductcountdown'}', '{l s='Friday' mod='wdproductcountdown'}', '{l s='Saturday' mod='wdproductcountdown'}']{literal}
                },
                months: {
                    {/literal}shorthand: ['{l s='Jan' mod='wdproductcountdown'}', '{l s='Feb' mod='wdproductcountdown'}', '{l s='Mar' mod='wdproductcountdown'}', '{l s='Apr' mod='wdproductcountdown'}', '{l s='May' mod='wdproductcountdown'}', '{l s='Jun' mod='wdproductcountdown'}', '{l s='Jul' mod='wdproductcountdown'}', '{l s='Aug' mod='wdproductcountdown'}', '{l s='Sep' mod='wdproductcountdown'}', '{l s='Oct' mod='wdproductcountdown'}', '{l s='Nov' mod='wdproductcountdown'}', '{l s='Dec' mod='wdproductcountdown'}'],
                    longhand: ['{l s='January' mod='wdproductcountdown'}', '{l s='February' mod='wdproductcountdown'}', '{l s='March' mod='wdproductcountdown'}', '{l s='April' mod='wdproductcountdown'}', '{l s='May' mod='wdproductcountdown'}', '{l s='June' mod='wdproductcountdown'}', '{l s='July' mod='wdproductcountdown'}', '{l s='August' mod='wdproductcountdown'}', '{l s='September' mod='wdproductcountdown'}', '{l s='October' mod='wdproductcountdown'}', '{l s='November' mod='wdproductcountdown'}', '{l s='December' mod='wdproductcountdown'}']{literal}
                },
                firstDayOfWeek: 1
            }
        });
        {/literal}
    }
</script>