开发者

Jquery DatePicker Tooltip Format

开发者 https://www.devze.com 2023-04-09 02:57 出处:网络
This is my query i need the tooltip for all the days eg: when mouse over moves to the sep/27/2011. tooltip shoulddisplay should show as \"Tuesday,September 27,2011\". How to do implement this?.Thisis

This is my query i need the tooltip for all the days eg: when mouse over moves to the sep/27/2011. tooltip should display should show as "Tuesday,September 27,2011". How to do implement this?.This is my jquery datepicker

<script type="text/javascript">
 $(function() {
        $( "#<%= this.txtFrom.ClientID %>" ).datepicker({
            showOn: 'both',
            buttonImage: "Images/calendar.gif",
            buttonImageOnly: true,
            showmonth:true,
            autoSize: true,
            changeMonth: true,
            changeYear: true,
     开发者_Go百科       showAnim: 'slideDown',
            buttonText: "",
            duration: 'fast',
           showOtherMonths: true,
           selectOtherMonths: true
                });
        $(".ui-datepicker-trigger").mouseover(function() {
    $(this).css('cursor', 'pointer');
});
    });
</script

>

Finally i found the solution:

          beforeShowDay: function(date) { return [true, '', $.datepicker.formatDate('DD, MM d, yy', date)]; },

Then //otheroptions


Think you will need to have it on onSelect method:

$( "#<%= this.txtFrom.ClientID %>" ).datepicker({ 
    showOn: 'both',
    buttonImage: "Images/calendar.gif",
    buttonImageOnly: true,
    showmonth:true,
    autoSize: true,
    changeMonth: true,
    changeYear: true,
    showAnim: 'slideDown',
    buttonText: "",
    duration: 'fast',
    showOtherMonths: true,
    selectOtherMonths: true,
    // all your other options above.
    onSelect: function(dateText, inst) {
        var d = new Date(inst.selectedYear, inst.selectedMonth, inst.selectedDay),
            format = $.datepicker.formatDate( 'DD, d MM, yy', d ) 
        this.alt = format; //You may want to use title instead of alt, depending on what element you are using.
    }
});

Im using the alt text in this example to give you the format on the input

live example: http://jsbin.com/eliwut/

0

精彩评论

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

关注公众号