<style>
    #SolutionDate{z-index:9999 !important}
</style>
<script type="text/javascript" src="includes/js/jquery-ui-timepicker-addon.js"></script>
<script type="text/javascript" src="includes/js/script.js"></script>
<link rel="stylesheet" type="text/css" href="styles/[% $CSSTEMPLATE %]/css/jquery-ui-timepicker-addon.css" />
<form action="index.php?module=ticket&event=changeSolutionDate" method="post" id="hm" name="hm" class="form-horizontal form-label-left">
    <input type="hidden" name="tid" value="[% $tid %]" />
    <input type="hidden" name="save" id="save" value="0" />
    <div class="card panel-info shadow-sm rounded" style="margin-bottom: 0;">
        <div class="card-header">
            <div class="row">
                <div class="col-lg-6">
                    <span class="fcs-card-title h3">[% $user->gettext('Lösung bis') %]</span>
                </div>
                <div class="col-lg-6 text-end">
                    <input type="button" onclick="submitForm();" class="btn btn-outline-primary" value="[% $user->gettext('Speichern') %]" />
                </div>
            </div>
        </div>
        <div class="card-body">
            [% if $user->hasRight(6) %]

                <div class="form-group row mb-3">
                    <label class="col-lg-3 control-label">
                        [% $user->gettext('Lösung bis') %]
                    </label>
                    <div class="col-lg-9">
                        <div class="input-group">
                            <input type="text" class="form-control" id="SolutionDate"  name="SolutionDate" value="[% $SolutionDate %]">
                        </div>
                    </div>
                </div>
            [% /if %]

        </div>
    </div>


</form>

<script>
<!--
    $("#SolutionDate").datetimepicker({format: 'DD.MM.YYYY HH:mm',
        dateFormat: 'dd.mm.yy',
        minDate: new Date(),
        showTimepicker: true,
        currentText: 'Jetzt',
        closeText: 'OK',
        timeText: 'Zeit',
        hourText: 'Stunde'
    });

    function getFormattedDate(date) {
        var day = date.getDate();
        var month = date.getMonth() + 1;
        var year = date.getFullYear().toString().slice(2);
        return day + '.' + month + '.' + year;
    }

    function submitForm() {
        $('#save').val("1");
        $('#hm').submit();
    }
// -->
</script>


