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

Uncaught TypeError: Cannot read property 'append' of undefined on initialize date picker #547

Closed
ghost opened this Issue Sep 8, 2014 · 25 comments

Comments

Projects
None yet
@ghost

ghost commented Sep 8, 2014

Mr.

Please check the samples in : http://eonasdan.github.io/bootstrap-datetimepicker/

Minimum setup sample is broken with this error message: Uncaught TypeError: Cannot read property 'append' of undefined.

this happens aproximately 3 days ago.

I get the same in my code, using version 3.1.2, this was working 3 or 4 days ago.

Thanks in advance.

@nikoskalogridis

This comment has been minimized.

Show comment
Hide comment
@nikoskalogridis

nikoskalogridis Sep 8, 2014

Contributor

Just tested it and it works fine

Contributor

nikoskalogridis commented Sep 8, 2014

Just tested it and it works fine

@nikoskalogridis

This comment has been minimized.

Show comment
Hide comment
@nikoskalogridis

nikoskalogridis Sep 10, 2014

Contributor

Please provide a jsfiddle per readme instructions to demonstrate your problem. I am going to close this and reopen it once you provide the jsfiddle to remove clutter

Contributor

nikoskalogridis commented Sep 10, 2014

Please provide a jsfiddle per readme instructions to demonstrate your problem. I am going to close this and reopen it once you provide the jsfiddle to remove clutter

@ghost

This comment has been minimized.

Show comment
Hide comment
@ghost

ghost Sep 11, 2014

screen shot 2014-09-11 at 09 40 54
Mr.
I have no time to provide a fiddle now :(.
but if you look in this site : http://eonasdan.github.io/bootstrap-datetimepicker/ and open the web
inspector console, you can see the error, and the "Minimum Setup " sample still not working.

When i have some time i will post a fiddle, but the error should be absolutely reproducible for you, considering the error is happening in your own demo page.

Thanks in advance.

ghost commented Sep 11, 2014

screen shot 2014-09-11 at 09 40 54
Mr.
I have no time to provide a fiddle now :(.
but if you look in this site : http://eonasdan.github.io/bootstrap-datetimepicker/ and open the web
inspector console, you can see the error, and the "Minimum Setup " sample still not working.

When i have some time i will post a fiddle, but the error should be absolutely reproducible for you, considering the error is happening in your own demo page.

Thanks in advance.

@nikoskalogridis

This comment has been minimized.

Show comment
Hide comment
@nikoskalogridis

nikoskalogridis Sep 11, 2014

Contributor

The error is not reproducable on my system. have a look on #551 should be a related issue

Contributor

nikoskalogridis commented Sep 11, 2014

The error is not reproducable on my system. have a look on #551 should be a related issue

@ghost

This comment has been minimized.

Show comment
Hide comment
@ghost

ghost Sep 11, 2014

Mmmm, from firefox works fine, but in Chrome 37 fails , i'm using OSX 10.9.

Thanks anyway.

ghost commented Sep 11, 2014

Mmmm, from firefox works fine, but in Chrome 37 fails , i'm using OSX 10.9.

Thanks anyway.

@tomasmuller

This comment has been minimized.

Show comment
Hide comment
@tomasmuller

tomasmuller Oct 20, 2014

Same problem here.
Using OSX 10.9.5, and Chrome Version 38.0.2125.104.

bootstrap_datetimepicker

tomasmuller commented Oct 20, 2014

Same problem here.
Using OSX 10.9.5, and Chrome Version 38.0.2125.104.

bootstrap_datetimepicker

@drecchia

This comment has been minimized.

Show comment
Hide comment
@drecchia

drecchia Oct 20, 2014

Same problem here.
Using OSX 10.7.5, Chrome 37.0, Firefox is working.

drecchia commented Oct 20, 2014

Same problem here.
Using OSX 10.7.5, Chrome 37.0, Firefox is working.

@tomasmuller

This comment has been minimized.

Show comment
Hide comment
@tomasmuller

tomasmuller Oct 20, 2014

Yes, with Firefox and Safari is working fine.

tomasmuller commented Oct 20, 2014

Yes, with Firefox and Safari is working fine.

@drecchia

This comment has been minimized.

Show comment
Hide comment
@drecchia

drecchia Oct 20, 2014

Is there any branch that fix this issue?
Ive tested moment.js of issue #551 and its ok, incrementing 1 day as supposed.

drecchia commented Oct 20, 2014

Is there any branch that fix this issue?
Ive tested moment.js of issue #551 and its ok, incrementing 1 day as supposed.

@durbine

This comment has been minimized.

Show comment
Hide comment
@durbine

durbine Oct 20, 2014

Same problem here.
In my case I'm using Win 7.
Both Chrome 38.0.2125.104 and Safari 5.1.7 not working.
IE 11.0.9 and Firefox 33.0 is working.

durbine commented Oct 20, 2014

Same problem here.
In my case I'm using Win 7.
Both Chrome 38.0.2125.104 and Safari 5.1.7 not working.
IE 11.0.9 and Firefox 33.0 is working.

@tomasmuller

This comment has been minimized.

Show comment
Hide comment
@tomasmuller

tomasmuller Oct 20, 2014

Dude, I'm so intrigued with this because it was completely working on my Google Chrome yesterday! But today it is not working anymore. Can't figure out what's going on.

I say this because I used this component on my entry on RailsRumble this year:

http://railsrumble.com/entries/10-groupgo

😢

tomasmuller commented Oct 20, 2014

Dude, I'm so intrigued with this because it was completely working on my Google Chrome yesterday! But today it is not working anymore. Can't figure out what's going on.

I say this because I used this component on my entry on RailsRumble this year:

http://railsrumble.com/entries/10-groupgo

😢

@drecchia

This comment has been minimized.

Show comment
Hide comment
@drecchia

drecchia Oct 20, 2014

at bootstrap-datetimepicker.js

line 496:
row.append...

Change for:
if ( row != null ) {
row.append...
}

Seens to fix the problem..

drecchia commented Oct 20, 2014

at bootstrap-datetimepicker.js

line 496:
row.append...

Change for:
if ( row != null ) {
row.append...
}

Seens to fix the problem..

@bernardoamc

This comment has been minimized.

Show comment
Hide comment
@bernardoamc

bernardoamc Oct 20, 2014

Seems like the problem is in moment.js, it's not taking into account the daylight saving.

moment_error

You can fix this problem by changing moment().startOf('week').weekday() in this line to: moment.localeData()._week.dow, this variable holds the localized start day of week.

moment.js use this here

bernardoamc commented Oct 20, 2014

Seems like the problem is in moment.js, it's not taking into account the daylight saving.

moment_error

You can fix this problem by changing moment().startOf('week').weekday() in this line to: moment.localeData()._week.dow, this variable holds the localized start day of week.

moment.js use this here

@Onumis

This comment has been minimized.

Show comment
Hide comment
@Onumis

Onumis Oct 20, 2014

same problem here, using ubuntu 14.04 on chrome Version 38.0.2125.104 (64-bit) only.
screenshot from 2014-10-20 14 51 19

Onumis commented Oct 20, 2014

same problem here, using ubuntu 14.04 on chrome Version 38.0.2125.104 (64-bit) only.
screenshot from 2014-10-20 14 51 19

@tomasmuller

This comment has been minimized.

Show comment
Hide comment
@tomasmuller

tomasmuller Oct 20, 2014

Maybe @timrwood or @ichernev can help us to discover the real cause of this problem?

What puzzles me is that this was working fine yesterday, in all browsers including Chrome. I tested it a lot yesterday. But today my RailsRumble entry was ruined! 😢 😢

tomasmuller commented Oct 20, 2014

Maybe @timrwood or @ichernev can help us to discover the real cause of this problem?

What puzzles me is that this was working fine yesterday, in all browsers including Chrome. I tested it a lot yesterday. But today my RailsRumble entry was ruined! 😢 😢

@timrwood

This comment has been minimized.

Show comment
Hide comment
@timrwood

timrwood Oct 20, 2014

This is probably because Brazil's DST starts at midnight, so the hour between Oct 19 2014 12:00am and Oct 19 2014 1:00am does not actually exist. Chrome is adjusting for this by rolling the clock backwards an hour to Oct 18 2014 11:00 pm.

I'd suggest using moment.utc() to construct days for populating a calendar, as it does not use DST.

timrwood commented Oct 20, 2014

This is probably because Brazil's DST starts at midnight, so the hour between Oct 19 2014 12:00am and Oct 19 2014 1:00am does not actually exist. Chrome is adjusting for this by rolling the clock backwards an hour to Oct 18 2014 11:00 pm.

I'd suggest using moment.utc() to construct days for populating a calendar, as it does not use DST.

@rodrigoruiz

This comment has been minimized.

Show comment
Hide comment
@rodrigoruiz

rodrigoruiz Oct 20, 2014

Having the same problem here and I can confirm that @bernardoamc 's solution works.

Although, I don't know if it is related to the same problem, but the css for some days is also not working.
Try selecting any following days of this month (21, 22, 23, ..., 31), they get selected in the input box, but the day does not turn blue.
You can reproduce this in Safari at http://eonasdan.github.io/bootstrap-datetimepicker/, not just chrome with @bernardoamc 's fix.

rodrigoruiz commented Oct 20, 2014

Having the same problem here and I can confirm that @bernardoamc 's solution works.

Although, I don't know if it is related to the same problem, but the css for some days is also not working.
Try selecting any following days of this month (21, 22, 23, ..., 31), they get selected in the input box, but the day does not turn blue.
You can reproduce this in Safari at http://eonasdan.github.io/bootstrap-datetimepicker/, not just chrome with @bernardoamc 's fix.

@valtlfelipe

This comment has been minimized.

Show comment
Hide comment
@valtlfelipe

valtlfelipe Oct 20, 2014

Had the same problem, I can confirm too that @bernardoamc solution works.

But as @rodrigoruiz said, there are some CSS related problems with this workaround, in all browsers.

valtlfelipe commented Oct 20, 2014

Had the same problem, I can confirm too that @bernardoamc solution works.

But as @rodrigoruiz said, there are some CSS related problems with this workaround, in all browsers.

@rodrigoruiz

This comment has been minimized.

Show comment
Hide comment
@rodrigoruiz

rodrigoruiz Oct 20, 2014

@valtlfelipe even without the workaround, the CSS problemas still exist. Try this http://eonasdan.github.io/bootstrap-datetimepicker/ in Safari.

rodrigoruiz commented Oct 20, 2014

@valtlfelipe even without the workaround, the CSS problemas still exist. Try this http://eonasdan.github.io/bootstrap-datetimepicker/ in Safari.

@valtlfelipe

This comment has been minimized.

Show comment
Hide comment
@valtlfelipe

valtlfelipe Oct 20, 2014

@rodrigoruiz It's true, In Firefox and IE (9,10,11) the same thing.

valtlfelipe commented Oct 20, 2014

@rodrigoruiz It's true, In Firefox and IE (9,10,11) the same thing.

@antonio-hansen

This comment has been minimized.

Show comment
Hide comment
@antonio-hansen

antonio-hansen Oct 21, 2014

Yeah it is not taking into account the daylight saving time which actually turns Brazilian UTC time from UTC -03:00 to UTC -02:00.
You could also use a try/catch like this:

try{

row.append('' + prevMonth.date() + '');
}
catch(exc)
{
}

antonio-hansen commented Oct 21, 2014

Yeah it is not taking into account the daylight saving time which actually turns Brazilian UTC time from UTC -03:00 to UTC -02:00.
You could also use a try/catch like this:

try{

row.append('' + prevMonth.date() + '');
}
catch(exc)
{
}

@cassia-sf

This comment has been minimized.

Show comment
Hide comment

cassia-sf commented Oct 21, 2014

@ricardoberti

This comment has been minimized.

Show comment
Hide comment
@ricardoberti

ricardoberti Oct 22, 2014

I've done what @bernardoamc wrote and it seems to fixed. Thx

ricardoberti commented Oct 22, 2014

I've done what @bernardoamc wrote and it seems to fixed. Thx

@ricardodovalle

This comment has been minimized.

Show comment
Hide comment
@ricardodovalle

ricardodovalle Oct 23, 2014

@bernardoamc Thank you very much 👏 , I've done what you wrote and it works.

ricardodovalle commented Oct 23, 2014

@bernardoamc Thank you very much 👏 , I've done what you wrote and it works.

@Eonasdan

This comment has been minimized.

Show comment
Hide comment
@Eonasdan

Eonasdan Nov 25, 2014

Owner

do any of you still have this issue with v4?

Owner

Eonasdan commented Nov 25, 2014

do any of you still have this issue with v4?

Repository owner locked and limited conversation to collaborators Jun 17, 2017

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.