function markOrder(date) {
    var date2 = date;
    var date = new Date(date);
    const options = { weekday: 'long', year: 'numeric', month: 'numeric', day: 'numeric' };
    date = date.toLocaleDateString("hr-HR", options);
    Swal.fire({
        title: 'Naručeno?',
        text: "Narudžba za " + date,
        icon: 'question',
        showCancelButton: true,
        confirmButtonColor: '#3085d6',
        cancelButtonColor: '#d33',
        cancelButtonText: 'Poništi',
        confirmButtonText: 'Da, označi'
      }).then((result) => {
        if (result.isConfirmed) {
            var idTag = date2;
            var url = "helpers/mark-order.php";
            var params = "date="+idTag;
            var xhr = new XMLHttpRequest();
            xhr.open("GET", url+"?"+params, true);
            xhr.onreadystatechange = function() {
                if (xhr.readyState === 4 && xhr.status === 200) {
                }
            };
            xhr.send();
            Swal.fire(
                'Označeno!',
                'Narudžba je završena.',
                'success'
            ).then((result) => {
                if (result.isConfirmed) {
                    location.reload();
                }
            })
        }
    })
}
