How to change default highlighted “today” date in datepicker

前端 未结 6 2056
粉色の甜心
粉色の甜心 2020-12-19 14:26

I\'m using datepicker for selecting dates in two date fields (from date and to date).

In those, the default highlighted date is today date. I need to change the defa

6条回答
  •  余生分开走
    2020-12-19 15:03

    Use onSelect option. It should looks like this:

    $('#datepickerID').datepicker({
                        onSelect: function(dateText, inst) {
                            $('#ui-datepicker-div').addClass("calendar-piced");
                        },
                        showButtonPanel: true,
                        gotoCurrent: true
                    });
    #datepickerID{
        &.calendar-piced{
            .ui-datepicker-today{
                a{
                    background: #f6f6f6;
                    border: 1px solid #c5c5c5;
                    color: #454545;
                }
            }
        }
    }

提交回复
热议问题