-
Notifications
You must be signed in to change notification settings - Fork 1k
getDate null if you use only slider #470
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I have the same problem! |
My workaround is adding this piece of code in _updateDateTime method: if(dp_inst.lastVal==""){
dp_inst.currentYear=dp_inst.selectedYear;
dp_inst.currentMonth=dp_inst.selectedMonth;
dp_inst.currentDay=dp_inst.selectedDay;
} so, this method should be like this: _updateDateTime: function(dp_inst) {
dp_inst = this.inst || dp_inst;
var dt = $.datepicker._daylightSavingAdjust(new Date(dp_inst.selectedYear, dp_inst.selectedMonth, dp_inst.selectedDay)),
dateFmt = $.datepicker._get(dp_inst, 'dateFormat'),
formatCfg = $.datepicker._getFormatConfig(dp_inst),
timeAvailable = dt !== null && this.timeDefined;
this.formattedDate = $.datepicker.formatDate(dateFmt, (dt === null ? new Date() : dt), formatCfg);
var formattedDateTime = this.formattedDate;
// Workaround
if(dp_inst.lastVal==""){
dp_inst.currentYear=dp_inst.selectedYear;
dp_inst.currentMonth=dp_inst.selectedMonth;
dp_inst.currentDay=dp_inst.selectedDay;
} Maybe is not the best solution, but it seems to work fine ;-) |
I had the same issue and the workaround above worked for me. |
same issue. same workaround |
trentrichardson
added a commit
that referenced
this issue
Jan 29, 2013
Thanks for posting the fix, sorry it took so long. It is now in the dev branch for testing. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If you set the time with the slider whitout selecting a date (today is selected by default) getDate return null.
For the same reason, even in the demo on the website restrict to start and end dates don't work well if you use only the slider. When you select the second input resets the first.
The text was updated successfully, but these errors were encountered: