parmarmayur9090 / jquery-datepicker

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

If input contains invalid date (or text), results is null and throw an error (patch inside) #360

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1) create a input field like this:
<input type="text" name="datepicker1" value="Start date" />
2) add that script :
<script type="text/javascript">
$(document).ready(function(){
  $("input[name=datepicker1]").datePicker({})
});
</script>

What is the expected output? What do you see instead?
I expect to have the datepicker working but firebug show the following error:
result is null : var res = result[i+1]; date.js (ligne 477)

What version of the datepicker are you using? On what operating system? And 
Which Browser?
debian, last version found on your website

Please provide any additional information below.

This can be easily fixed by adding the following at line 476:

 if (!result)  return d;

I also replaced the following, line 443, for my personal needs (I prefer to 
have the actual date more than the 1st january 1970) : 
var d = new Date('01/01/1970');
by
var d = new Date();

I attach the patch file

Original issue reported on code.google.com by michael....@gmail.com on 20 Nov 2012 at 4:54

Attachments: