jQuery UI DatePicker - Disable all days except last day of month

前端 未结 2 1150
栀梦
栀梦 2021-02-14 03:17

I\'m trying to use the jquery UI datepicker to show a calendar with only the last day of the month selectable.

I\'ve successfully used the beforeShowDay event to disabl

2条回答
  •  情话喂你
    2021-02-14 03:46

    function LastDayOfMonth(Year, Month) { 
        //set next month first day
        //substract one day from it.        
        return new Date(new Date(Year, Month+1,1)-1).getDate(); 
    } 
    

    This will work

提交回复
热议问题