You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I recently upgraded from pickadate 3.3.2 to 3.5.4 and now the wrong dates are being disabled, you can see from the screenshot:
The dates I've tried to disable are the 18th and 26th of October amongst others, as you can see these dates are both available but the 17th and 25th are disabled instead.
I'm in the UK by the way I don't know if that has anything to do with it, with regards to locale etc.
Here is the code to replicate this issue...
<html>
<head>
<script src="http://code.jquery.com/jquery-1.10.2.min.js"></script>
<link id="theme_base" href="http://amsul.ca/pickadate.js/lib/themes/classic.css" rel="stylesheet" />
<link id="theme_date" href="http://amsul.ca/pickadate.js/lib/themes/classic.date.css" rel="stylesheet" />
<link id="theme_time" href="http://amsul.ca/pickadate.js/lib/themes/classic.time.css" rel="stylesheet" />
<script src="http://amsul.ca/pickadate.js/lib/picker.js"></script>
<script src="http://amsul.ca/pickadate.js/lib/picker.date.js"></script>
<script src="http://amsul.ca/pickadate.js/lib/picker.time.js"></script>
<script src="http://amsul.ca/pickadate.js/lib/legacy.js"></script>
<script type="text/javascript">
$(function() {
var OCT = 9;
var NOV = 10;
var DEC = 11;
$('.datepicker').pickadate({
disable: [
new Date(2014,OCT,18),
new Date(2014,OCT,26),
new Date(2014,OCT,27),
new Date(2014,OCT,28),
new Date(2014,OCT,29),
new Date(2014,OCT,30),
new Date(2014,OCT,31),
new Date(2014,NOV,01),
new Date(2014,NOV,02),
new Date(2014,NOV,29),
new Date(2014,DEC,22),
new Date(2014,DEC,23),
new Date(2014,DEC,24),
new Date(2014,DEC,25),
new Date(2014,DEC,26)
]
});
});
</script>
</head>
<body>
<input type="text" class="datepicker" />
</body>
</html>
The text was updated successfully, but these errors were encountered:
It is to do with the change that was made to use UTC dates instead of the normal date. Locally i've changed all calls to getUTCxxx back to the non UTC versions and it's working fine.
This shows what happens in a UK Locale when we're in daylight savings time....
<html>
<head>
<script type="text/javascript">
var OCT = 9
var d = new Date(2014,OCT,18)
</script>
</head>
<body>
<br/>
getUTCDate(): <script>document.write(''+d.getUTCDate())</script>
<br/>
getDate(): <script>document.write(''+d.getDate())</script>
<br/>
</body>
</html>
The output of this html is...
getUTCDate(): 17
getDate(): 18
I can see that some work has been done to revert this change, but the latest code from the dev branch still doesn't work correctly.
I recently upgraded from pickadate 3.3.2 to 3.5.4 and now the wrong dates are being disabled, you can see from the screenshot:
The dates I've tried to disable are the 18th and 26th of October amongst others, as you can see these dates are both available but the 17th and 25th are disabled instead.
I'm in the UK by the way I don't know if that has anything to do with it, with regards to locale etc.
Here is the code to replicate this issue...
The text was updated successfully, but these errors were encountered: