{% load i18n %}

{% get_current_language as LANG %}

<script>
    {% if LANG == 'ru-ru' or LANG == 'ru' %}
        var dt_format = 'DD.MM.YYYY HH:mm:ss',
                d_format = 'DD.MM.YYYY',
                locale = 'ru';
    {% else %}
        var dt_format = 'YYYY-MM-DD HH:mm:ss',
                d_format = 'YYYY-MM-DD',
                locale = 'en';
    {% endif %}

    var initDatePickers = function () {
        $(".datetime").datetimepicker({format: dt_format, locale: locale, showTodayButton: true, showClear: true});
        $(".date").datetimepicker({format: d_format, locale: locale, showTodayButton: true, showClear: true});
        $(".time").datetimepicker({format: 'HH:mm:ss', locale: locale});
    };

    $(function () {
        initDatePickers();
    });
</script>
