<script>
    $(function () {

        $('a.place-schedule-delete').click(function (ev) {
            $('#attr-place-schedule-id-delete').val($(this).data('id'));
            $("#attr-place-schedule-begin input, #attr-place-schedule-end input").prop('required', false);
            $("#attr-place-schedule-day").prop('required', false);
        });

        $('a.place-schedule-update-default').click(function (ev) {
            $("#attr-place-schedule-id-update").val($(this).data('id'));
            $("#attr-place-schedule-id").val($(this).data('id'));
            $("#attr-place-schedule-begin input", "#place-schedule-update").val($(this).data('begin'));
            $("#attr-place-schedule-end input", "#place-schedule-update").val($(this).data('end'));
            $('#attr-place-schedule-day option[value="' + $(this).data('day') + '"]', '#place-schedule-update').prop('selected', true);
            $("#attr-place-schedule-day").prop('required', true);
        });

        $('a.place-schedule-create').click(function (ev) {
            $('#attr-place-id').val($(this).data('id'));
            $("#attr-place-schedule-begin input, #attr-place-schedule-end input").prop('required', true);
            $("#attr-place-schedule-day").prop('required', true);
        });


        {$langcode = {lang attr="code"}|substr:0:2}
        $(document).ready(function () {
            $('.input-group.time').datetimepicker({
                locale: "{$langcode}",
                format: 'HH:mm',
                stepping: 15
            });
        });
        $(document).ready(function () {
            $('.input-group.date').datetimepicker({
                locale: "{$langcode}",
                format: 'YYYY-MM-DD'
            });
        });
    });
</script>
