Had an issue when i was calling a modal and loading a page via ajax..
The page had a datepicker which values was set via php
It worked the first time but if you closed the modal and re-opened it, it would lose the value of date which caused the date.split(format.separator) to fail which failed all other plugins.
Not sure why this was happening.
Had to revert to normal jquery datepicker as no time to mess around with it.
I am experiencing the same issue.
After laoding a first ajax modal with a datepicker. Loading subsequent ajax modals with datepickers gives rise to the following error:
Uncaught TypeError: Cannot call method 'split' of undefined
DPGlobal.parseDateapplication.js:10369
Datepicker.updateapplication.js:10155
Datepickerapplication.js:10094
$.fn.datepickerapplication.js:10320
jQuery.extend.eachapplication.js:612
jQuery.fn.jQuery.eachapplication.js:242
$.fn.datepickerapplication.js:10315
(anonymous function)application.js:12854
jQuery.extend.eachapplication.js:596
jQuery.fn.jQuery.eachapplication.js:242
jQuery.fn.load.jQuery.ajax.completeapplication.js:7313
jQuery.Callbacks.fireapplication.js:975
jQuery.Callbacks.self.fireWithapplication.js:1083
doneapplication.js:7666
jQuery.ajaxTransport.send.callback
this causes behaviour linked to datepicker's 'changeDate' event to not work.
This is because "date" obj is not type of "string".
This error happen at code below.
++++++++++++++++++++++++
parseDate: function(date, format) {
var parts = date.split(format.separator), <=== HERE
++++++++++++++++++++++++
The solution is to make date object as a string at forcibly.
Revised Code is below.
++++++++++++++++++++++++
parseDate: function(date, format) {
date = date + ""; <==== THIS LINE IS UPDATED!
var parts = date.split(format.separator),
++++++++++++++++++++++++
Good Luck!!
I had this problem with the version of datepicker currently downloadable from http://www.eyecon.ro/. But when I replaced it with the code from this repo, the problem went away.
@kuroi Thank you. I had the same issue and it was resolved by updating the js and css from the repo.
Thank you!
Thank you! I changed the file and it works!
Thank You very much!!!!!!!!!!!
I had a problem in datepicker,i used datepicker in ajax page, but its not working, but the datepicker is working in my normal page. help me please..
You probably need to call the datepicker function again when the Ajax page
has loaded.
On Thursday, 11 July 2013, sarathnath420 wrote:
I had a problem in datepicker,i used datepicker in ajax page, but its not
working, but the datepicker is working in my normal page. help me please..—
Reply to this email directly or view it on GitHubhttps://github.com/eternicode/bootstrap-datepicker/issues/193#issuecomment-20791239
.
Myles Beardsmore
Web Developer
mylesb.me
@songaal thank you so much! This worked perfectly. It was killing all of my other functions on the page, but this solved the issue. The original code has the arguments the same as the object below it and dies
@songaal perfect fix, cheers!
@melbourne2991 @tbarnes Happy to help you :)
Thanks..!
Thank You. It worked for me.
Thank you @songaal
Now after your hack and also playing around with z-index, the datepicker works great with bootstrap modals :+1:
Thank you! Replacing the file with eyecon and it works!
Most helpful comment
This is because "date" obj is not type of "string".
This error happen at code below.
++++++++++++++++++++++++
parseDate: function(date, format) {
var parts = date.split(format.separator), <=== HERE
++++++++++++++++++++++++
The solution is to make date object as a string at forcibly.
Revised Code is below.
++++++++++++++++++++++++
parseDate: function(date, format) {
date = date + ""; <==== THIS LINE IS UPDATED!
var parts = date.split(format.separator),
++++++++++++++++++++++++
Good Luck!!