Search and Top Navigation
#14910 closed bug (duplicate)
Opened January 25, 2016 10:30AM UTC
Closed January 25, 2016 03:23PM UTC
Datepicker: showWeek doesn't show the right calendar week if firstDay is 0 and year is 2016
Reported by: | dasago87 | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | |
Component: | ui.datepicker | Version: | 1.11.0 |
Keywords: | datepicker calendar showWeek | Cc: | |
Blocked by: | Blocking: |
Description
If showWeek = true, firstDay = 0 and the year is 2016 the displayed calendar week is wrong. The first calendarWeek start at 10. January instead of 3. January. If firstDay is 1 it is fine. The first calendar week starts at 4. January.
<!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>jQuery UI Datepicker - Show week of the year</title> <link rel="stylesheet" href="//code.jquery.com/ui/1.11.0/themes/smoothness/jquery-ui.css"> <script src="//code.jquery.com/jquery-1.10.2.js"></script> <script src="//code.jquery.com/ui/1.11.0/jquery-ui.js"></script> <link rel="stylesheet" href="/resources/demos/style.css"> <script> $(function() { $( "#datepicker" ).datepicker({ showWeek: true, firstDay: 0 }); }); </script> </head> <body> <p>Date: <input type="text" id="datepicker"></p> </body> </html>
Example added in JS Bin