Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #1459789

    Guten Tag liebes kriesi-Team,

    ich bräuchte in der Funktion “Datumsauswahl” die Möglichkeit direkt bis zum Jahr 1920 zurückzugehen. Über Umwege geht das nur, indem ich 1944 auswähle und dann mit dem Button “vorher” ein jahr zurück gehe. Dann bekomme ich die Jahre davor zur Auswahl angezeigt.

    Kann ich diese Option einstellen?

    Vielen Dank.
    Markus

    #1459797

    Das hier in die Child-Theme functions.php:

    function my_datepicker_defaults() {
    ?>
    <script type="text/javascript">
    window.addEventListener("DOMContentLoaded", function () { 
    (function($) {        
        $(".avia_datepicker").datepicker({
    		beforeShow: function(input, inst) {
    			jQuery("#ui-datepicker-div").addClass(this.id);
    			inst.dpDiv.addClass("avia-datepicker-div");
    		},
    		showButtonPanel: true,
    		closeText: AviaDatepickerTranslation.closeText,
    		currentText: AviaDatepickerTranslation.currentText,
    		nextText: AviaDatepickerTranslation.nextText,
    		prevText: AviaDatepickerTranslation.prevText,
    		monthNames: AviaDatepickerTranslation.monthNames,
    		monthNamesShort: AviaDatepickerTranslation.monthNamesShort,
    		dayName: AviaDatepickerTranslation.dayNames,
    		dayNamesShort: AviaDatepickerTranslation.dayNamesShort,
    		dayNamesMin: AviaDatepickerTranslation.dayNamesMin,
    		dayNames: AviaDatepickerTranslation.dayNames,
    		dateFormat: AviaDatepickerTranslation.dateFormat,
    		firstDay: AviaDatepickerTranslation.firstDay,
    		isRTL: AviaDatepickerTranslation.isRTL,
    		minDate: AviaDatepickerTranslation.minDate,
    		changeMonth: true,
    		changeYear: true,
    		yearRange: "c-100:c+10",
    	});          
    }(jQuery)); 
    }); 
    </script>
    <?php
    }
    add_action('wp_footer', 'my_datepicker_defaults', 20);

    Wenn du nicht in Abhängigkeit vom current Year ( das was oben gerade in der Leiste angezeigt wird ) die Dropdown Zeitspanne angeben willst kannst du auch oben stattdessen absolute Werte eintragen:
    yearRange: "1900:2034", oder ein Mix: yearRange: "1900:c+10",

    Leider fand ich keine Möglichkeit mich in die Funktion einzuhaken , um nur diesen Wert zu ändern , und die default Werte unverändert zu belassen.
    die Einstellung yearRange ist hier zuständig.

    #1459813

    by the way dear devs / mods – shouldn’t the today button insert the date of today in that input field ? – it only shows the current date in the days table.

    #1459869

    Hi,

    For 6.0 I added filter avf_form_datepicker_args that allows to change all arguments. See https://github.com/KriesiMedia/enfold-library/blob/master/actions%20and%20filters/ALB%20Elements/Contact%20Form/avf_form_datepicker_args.php


    @Guenni007

    today button

    This is the default behaviour of this element.

    Best regards,
    Günter

    #1459872

    Brilliant – Thanks again.

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.