engineer9090909090909090 / jquery-datepicker

Automatically exported from code.google.com/p/jquery-datepicker
0 stars 0 forks source link

this.getFullYear is not a function #259

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I include libraries like this:

<link rel="stylesheet" type="text/css" 
href="/includes/css/datePicker.css"></link>
<script type=text/javascript src="/includes/js/jquery-1.4.2.min.js"></script> 
<!--Datepicker - http://www.kelvinluck.com/projects/jquery-date-picker/-->
<script type="text/javascript" 
src="/includes/js/jquery.datePicker.min-2.1.2.js"></script>
<script type="text/javascript" src="/includes/js/date.js"></script>
<!--[if IE]><script type="text/javascript" 
src="/includes/js/jquery.bgiframe.js"></script><![endif]-->

>>What steps will reproduce the problem?
I configure a text input (input[name=dateTimeVerzonden]) on my page like this:

$(document).ready(function(){
    $("input[name=dateTimeVerzonden]").datePicker({startDate:'01/01/2009'})
        .bind('click',
            function(){
                $(this).dpDisplay();
                this.blur();
                return false;
            })
        .bind('dateSelected',
            function(e,selectedDate,$td){
                updateFactuur(e,selectedDate,$td);
            });
});

function updateFactuur(e,selectedDate,$td){
    var args={};
    args.eventName="factuur.update"+$e.attr('id');
    args.date=selectedDate;
    args.factuurId=$e.attr('factuurId');
alert(args.factuurId+"="+args.date)
    $.post(
        "/RemotingService.cfc?method=executeEvent&returnFormat=json",
        args
    );
    return false;
}

>>What is the expected output? What do you see instead?

The alert(args.factuurId+"="+args.date) shows correctly the id and date.

I expect the Ajax call to go on after the alert. What I see after clicking away 
the alert an error message in Firebug "this.getFullYear is not a function
" pointing to line 29 in date.js (Additional methods and properties).

>>What version of the datepicker are you using? On what operating system? And 
Which Browser?
jquery.datePicker.min-2.1.2.js with jquery 1.4.2. Mac OS X, FireFox 3.6.13

Thanks,

Marc

Original issue reported on code.google.com by marc.at....@gmail.com on 31 Dec 2010 at 12:27

GoogleCodeExporter commented 8 years ago
Btw, This happens also when I include libraries as indicated on the website:

<script type=text/javascript src="/includes/js/jquery-1.4.2.min.js"></script> 
<script type="text/javascript" src="/includes/js/date.js"></script>
<!--[if IE]><script type="text/javascript" 
src="/includes/js/jquery.bgiframe.js"></script><![endif]-->
<!--Datepicker - http://www.kelvinluck.com/projects/jquery-date-picker/-->
<script type="text/javascript" 
src="/includes/js/jquery.datePicker.min-2.1.2.js"></script>

Original comment by marc.at....@gmail.com on 31 Dec 2010 at 12:33

GoogleCodeExporter commented 8 years ago
Strange... How does args.date alert? It should be a Date object so probably the 
native toString method is called when $.post tries to serialise it... You could 
instead try:

args.date = selectedDate.asString();

Which will format the date according to the Date.format you have set...

If that doesn't help please provide a URL showing the problem and I will try to 
take a look...

Original comment by kelvin.l...@gmail.com on 10 Jan 2011 at 11:03

GoogleCodeExporter commented 8 years ago
Issue closed - I didn't include all libraries so it was not an issue with 
datePicker...

Original comment by marc.at....@gmail.com on 10 Jan 2011 at 11:30

GoogleCodeExporter commented 8 years ago

Original comment by kelvin.l...@gmail.com on 10 Jan 2011 at 11:33

GoogleCodeExporter commented 8 years ago
What library did you miss? 

<script src="js/date.js" type="text/javascript"></script>
<script src="js/jquery.datePicker.js" type="text/javascript"></script>

And it still throws the same error. 

Original comment by thomas.a...@gmail.com on 14 Oct 2011 at 6:33

GoogleCodeExporter commented 8 years ago
I guess that there is a problem loading date.js on your page. Date.getFullYear 
is defined in that file so the problem must be that that file doesn't load...

Original comment by kelvin.l...@gmail.com on 15 Oct 2011 at 8:33

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
adsadsadsadsadsa

Original comment by nguyenda...@gmail.com on 7 May 2013 at 5:27