Search code examples
alloy-ui

AlloYUI: aui datepicker with showNextYear and showPreviousYear buttons?


I'm using alloYUI datepicker. I can show next/prev month button, but I would like to show also the next/prev YEAR button. Otherwise it will be useless for most uses where selection is required several years in the past or future.

I wonder if it's possible to do that, as I can't find anything in the documentation and I'm not sure how to extend the component


Solution

  • Put aui input control like this :

    <aui:input name="dob" cssClass="dobClass" id="dob" title="Date Of Birth" placeholder="dd/mm/yyyy" readonly="true" >
    

    Script to apply :

    $(".dobClass").datepicker({ dateFormat: "dd/mm/yy",minDate: new Date(), changeYear: true,changeMonth: true,yearRange: "-0:+10y", onClose: function(date, datepicker) {$(".dobClass").focus(); }});