function showToast(type, title, text, time) { $('#toast-'+type+' .toast-header .small').html(time); $('#toast-'+type+' .toast-header .me-auto').html(title); $('#toast-'+type+' .toast-body .fw-semibold').html(text); $('#toast-'+type+'').toast('show'); } function isValidDate(s) { var bits = s.split('-'); var d = new Date(bits[0], bits[1] - 1, bits[2]); return d && (d.getMonth() + 1) == bits[1]; } $(document).ready(function(){ $('.tip').each(function () { $(this).tooltip( { html: true, title: $('#' + $(this).data('tip')).html() }); }); moment.locale('de'); $.datepicker.setDefaults( $.extend({ 'dateFormat':'yy-mm-dd' }, $.datepicker.regional['de'] ) ); var date = new Date(); $('.datepicker').datepicker({ locale: { format: 'YYYY-MM-DD' }, startDate: date, minDate: date, todayHighlight: true, autoclose: true, orientation: 'top' }); $('.daterange').daterangepicker({ locale: { format: 'YYYY-MM-DD', cancelLabel: 'Abbrechen', applyLabel: 'Anwenden' }, opens: 'left', startDate: date, minDate: date, }, function(start, end, label) { /*console.log("A new date selection was made: " + start.format('YYYY-MM-DD') + ' to ' + end.format('YYYY-MM-DD'));*/ }); $('.toast').toast({ delay: 2000, autohide: true }); $(".coupon-modal-close").on("click", function() { $(".coupon-popup-wrapepr").removeClass("active") }); });