English 中文(简体)
j Query Annualpicker disable Annuals Problem on IE
原标题:jQuery Datepicker disable Dates Problem on IE

www.un.org/Depts/DGACM/index_spanish.htm Hey Guys,

i have a big problem with my jQuery Datepicker Script. I use jQuery 1.4.2 and jQuery Ui 1.8.

Background: I have a reservation calendar with a fromDate and toDate and all Dates which are already reserved are disabled. The Dates come from Database by AJAX Call.

Problem: Everything works fine in Firefox - but IE 7/8 does not disable Dates execept for the actual month. I do not get any Error Message in IE 7/8!

我的守则如下:

www.un.org/Depts/DGACM/index_spanish.htm 第一,AJAX 要求获得日期:

    var navDays = (function () {
        var val = null;
        $.ajax({
             async : false,
             global : false,
             url : WEG_URL+ rsv_avdates.php ,
             success : function (data) {
                val = data;                    
            }
        });
        return val;
    })();

    var disDays = navDays.split( | );  

In disDays i have nowdates such as 2010-01-01 , 2010-01-02 ....

www.un.org/Depts/DGACM/index_spanish.htm 在这里,我是站不住脚的。 日期:

    function disabledDays(date) {
        var m = date.getMonth();
        var d = date.getDate();
        var y = date.getFullYear();

        for (var i = 0; i <= disDays.length-1; i++) {
          var myDate = new Date(disDays[i]);              
          if ((m == (myDate.getMonth())) && (d == (myDate.getDate())) && (y == (myDate.getFullYear())))
          {
            return [false];
          }
        }
        return [true];
    }   

,最后是我的日皮克尔呼吁:

    $( #fromdate, #todate ).datepicker(
    {
        showOn: "both",
        buttonImage:  images/calender.gif ,
        buttonImageOnly: true,
        beforeShowDay: disabledDays,
        dateFormat: "dd.mm.y",
        firstDay: 1, 
        changeFirstDay: false
    }); 

你们是否想到,为什么所有工作都是在IE 7/8中精炼的:Safari、Shaw、...、但NOT?

感谢大家。

Sascha

最佳回答

问题在于,这些日期指示实际上并不适用于对日期标的进行即时。 在这里,你如何能够将“残疾”作为一系列的日期,使你能够仅仅利用那些直接承担退约职能的人,而不必在以下所有时间建立新的日期:

  var disDays = $.map(navDays.split( | ), function(d) {
    var dd = d.split( - );
    return new Date(parseInt(dd[0], 10), parseInt(dd[1], 10) - 1, parseInt(dd[2], 10));
  });

现在,退约法可以做到这一点:

     function disabledDays(date) {
      var m = date.getMonth();
      var d = date.getDate();
      var y = date.getFullYear();

      for (var i = 0; i <= disDays.length-1; i++) {
        var myDate = disDays[i];             
        if ((m == (myDate.getMonth())) && (d == (myDate.getDate())) && (y == (myDate.getFullYear())))
        {
          return [false];
        }
      }
      return [true];
    }  
问题回答

暂无回答




相关问题
getGridParam is not a function

The HTML: <a href="javascript:void(0)" id="m1">Get Selected id s</a> The Function: jQuery("#m1").click( function() { var s; s = jQuery("#list4").getGridParam( selarrrow )...

selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

jQuery cycle page with links

I am using the cycle plugin with pager functionality like this : $j( #homebox ) .cycle({ fx: fade , speed: fast , timeout: 9000, pager: #home-thumbs , ...

jquery ui dialog opens only once

I have a button that opens a dialog when clicked. The dialog displays a div that was hidden After I close the dialog by clicking the X icon, the dialog can t be opened again.

jConfirm with this existing code

I need help to use jConfirm with this existing code (php & Jquery & jAlert). function logout() { if (confirm("Do you really want to logout?")) window.location.href = "logout.php"; } ...

Wrap text after particular symbol with jQuery

What I m trying to do, is wrap text into div inside ll tag. It wouldn t be a problem, but I need to wrap text that appears particularly after "-" (minus) including "minus" itself. This is my html: &...

热门标签