Possible bug in datepicker
Not sure if this is a bug, or if I am just doing something wrong/unsupported.
- <!doctype html>
- <html lang="en">
- <head>
- <meta charset="utf-8">
- <title>jQuery UI Datepicker - Display month & year menus</title>
- <link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
- <script src="//code.jquery.com/jquery-1.10.2.js"></script>
- <script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
- <link rel="stylesheet" href="/resources/demos/style.css">
- <script>
- $(function() {
- $( "#datepicker" ).datepicker({
- changeMonth: true,
- changeYear: true,
- yearRange: "-20:-02"
- });
- });
- </script>
- </head>
- <body>
-
- <p>Date: <input type="text" id="datepicker"></p>
-
-
- </body>
- </html>
This is one of the demos from the jqueryui website, with the date range changed from an absolute range to "-20:-02". When I load this, the range of years is correct (1995-2013), but the first year in the range (1995 currently) appears in the drop-down, and if I immediately select a day (without changing the year), the current year (2015) shows up in the input. If I select a different year from the drop-down it works correctly, but something is wrong on initialization.
Is this a bug?
Thanks.
Matt