0

NB: This is just a question, so I'm not going to paste any code here.

I'm making a date picker for a charity, who have dates that go back as far as 1880, or even before.

On the jQuery datepicker, the furthest you can go back is 1913.

I'm just wondering if it is possible to make the date start from 1650 (thats like 300+ years ago) quite easily??? And has anybody else done this before?

  • Check out this link http://stackoverflow.com/questions/14591634/jquery-datepicker-set-date-to-tomorrows-date – M Gaidhane Nov 20 '13 at 18:18

2 Answers2

1

Check the year range option. Something like this may work:

$( ".selector" ).datepicker({ yearRange: "1900:2013" });
Peter Clause
  • 1,132
  • 9
  • 22
0

From the Jquery UI website: http://jqueryui.com/datepicker/#dropdown-month-year

You could preselect a date for the user. You could also allow the user to pick the year from a drop down using the options below:

<html lang="en">
<head>
<meta charset="utf-8" />
<title>jQuery UI Datepicker - Dates in other months</title>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
<link rel="stylesheet" href="/resources/demos/style.css" />
<script>
$(function() {
$( "#datepicker" ).datepicker({
showOtherMonths: true,
selectOtherMonths: true, 
changeMonth: true,
changeYear: true
});
});
</script>
</head>
<body>
<!-- Preselected Date here --> 
<p>Date: <input type="text" id="datepicker" value="01/02/1880"/></p>
</body>
</html>
CookieCoder
  • 351
  • 2
  • 6