{% extends "kfet/base_form.html" %}
{% block extra_head %}{{ form.media }}{% endblock %}

{% block title %}Caisse {{ checkout.name }} - Édition{% endblock %}
{% block header-title %}Édition de la caisse {{ checkout.name }}{% endblock %}

{% block main %}

{% include "kfet/form_full_snippet.html" with authz=perms.kfet.change_checkout submit_text="Mettre à jour" %}

<script type="text/javascript">

$(document).ready(function() {
    $('#id_valid_from').datetimepicker({
        //format    : 'YYYY-MM-DD HH:mm',
        stepping  : 5,
        locale    : 'fr',
        showTodayButton: true,
    });
    $('#id_valid_to').datetimepicker({
        //format    : 'YYYY-MM-DD HH:mm',
        stepping  : 5,
        useCurrent: false,
        locale    : 'fr',
        showTodayButton: true,
        useCurrent: false
    });
    $("#id_valid_from").on("dp.change", function (e) {
        $('#id_valid_to').data("DateTimePicker").minDate(e.date);
    });
    $("#id_valid_to").on("dp.change", function (e) {
        $('#id_valid_from').data("DateTimePicker").maxDate(e.date);
    });
});

</script>

{% endblock %}
