开发者

JQuery DatePicker Highlight Date onSelect

开发者 https://www.devze.com 2023-03-04 08:14 出处:网络
Hi I am trying to create a date range selector. below is the given code which I need to fill in. How do I highlight all the Selected date

Hi I am trying to create a date range selector. below is the given code which I need to fill in. How do I highlight all the Selected date

 $(document).ready(function () {
        $("#fromCalendar").datepicker({
            numberOfMonths: [1, 6],
            stepMonths: 1,
            autoSize: true,
            dateFormat: 'dd/mm/yy',
            onSelect: function (date) {
                selectDate(date);
            }

        });
    });
function selectDate(date开发者_如何学编程){
//Code
}


your_text_box.focus();
your_text_box.select();

should get your text selected I believe.


 $(document).ready(function () {
        numberOfMonths: [1, 6],
        stepMonths: 3,
        autoSize: true,
        changeMonth: true,
        changeYear: true,
        dateFormat: 'dd/mm/yy',
        onSelect: function (dateText, inst) {
            selectDate(dateText);
        },
        beforeShowDay: function (date) {
            var gotDate = $.inArray($.datepicker.formatDate($(this).datepicker('option', 'dateFormat'), date), dates);
            if (gotDate >= 0) {
                return [false, "ui-state-highlight ui-state-active ui-state-hover"];
            }
            return [true, ""];
        }
});

});
0

精彩评论

暂无评论...
验证码 换一张
取 消