This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Themabewertung:
  • 0 Bewertung(en) - 0 im Durchschnitt
  • 1
  • 2
  • 3
  • 4
  • 5
Datepicker
#1
Ich benutze folgenden Datepicker in einem Formular. Ich möchte folgende Änderung vornehmen.
Die gesperrten Termine sollen Buchbar sein, aber ein zusätzliches Feld in meinen Formular soll den Text "Schwieriger Termin, warten sie auf eine Bestätigung" erhhalten.
Für einen funkionierenden Code würde ich auch einen angemessenen Betragbezahlen.
Hier mein Datepicker:

  <script
  src="https://code.jquery.com/jquery-1.11.2.min.js"
  integrity="sha256-Ls0pXSlb7AYs7evhd+VLnWsZ/AqEHcXBeMZUycz/CcA="
  crossorigin="anonymous"></script>

<script
  src="https://code.jquery.com/ui/1.10.1/jquery-ui.min.js"
  integrity="sha256-Nnknf1LUP3GHdxjWQgga92LMdaU2+/gkzoIUO+gfy2M="
  crossorigin="anonymous"></script>


jQuery(document).ready(function (jQ) {
  jQ( '#flugdatum' ).datepicker({
    dateFormat:'yy-mm-dd',
    numberOfMonths: 4,
    minDate: -30,
    maxDate: '+10M +0D',
    beforeShowDay: unavailable
  });

var unavailableDates = ['25-12-2022', '31-12-2022', 1-1-2023];

  jQ( '#flugdatum' ).datepicker('option', 'enabled', true);

  function unavailable(date) {
    dmy = date.getDate() + "-" + (date.getMonth() + 1) + "-" + date.getFullYear();
    if (jQ.inArray(dmy, unavailableDates) == -1) {
      return [true, ''];
    } else {
      return [false, '', 'Unavailable'];
    }
  }
});



Freue mich auf Rückmeldungen
Heinz-J. Schmieding
Zitieren
#2
Könntest du einen funktionierenden Code posten, den man testen kann.
Zb bei Codepen, oder den ganzen Code hier posten.
Weil so fehlt ja alles (HTML, CSS) usw. Da kann ich ich jetzt nichts erkennen was zu deiner Beschreibung passt
Als Lösung markieren Zitieren


Gehe zu:


Benutzer, die gerade dieses Thema anschauen: 1 Gast/Gäste