Skip to content
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

Unable to select any date in April #376

Closed
emouawad opened this issue Jun 12, 2014 · 54 comments
Closed

Unable to select any date in April #376

emouawad opened this issue Jun 12, 2014 · 54 comments

Comments

@emouawad
Copy link

Unable to select any date In month of April, not in my application, not even in your own demo at: http://eonasdan.github.io/bootstrap-datetimepicker/ which freezes the whole browser (Chrome)

Variable a is null in function v.

screen shot 06-12-14 at 02 34 pm

@phaidon
Copy link

phaidon commented Jun 15, 2014

I can not reproduce that.

@emouawad
Copy link
Author

Seriously?!

Steps to reproduce:

No Date is shown to be selected, the Chrome console will show the error that i previously included as a snapshot.

@RodolfoSilva
Copy link
Contributor

This problem is happening to me too.

  • Go to November 1992
  • Pick any date of this month

@JoelBennett
Copy link

emouawad: I'm unable to replicate it using your steps. Same with Rodolfo Silva's steps. Both work fine for me. I wonder if it has something to do with language/location settings. E.g.: dd/mm/yy vs. mm/dd/yy, etc.

@Eonasdan
Copy link
Owner

There are several duplicate issues and I've never been able to reproduce them.

If you are having this problem please post code to jsfiddle and verify that your example is broken there as well. You can fork this fiddle which uses the javascript (non-minified) and css from the doc site.

@RodolfoSilva
Copy link
Contributor

I'm using this date format dd/mm/yyyy

@RodolfoSilva
Copy link
Contributor

I did the example's test that you posted and gave an error. It did not work click on the date of November in the year 1992.

@RodolfoSilva
Copy link
Contributor

captura_de_tela-4
captura_de_tela-5

@Eonasdan
Copy link
Owner

No errors for me:

image

@Eonasdan
Copy link
Owner

the append error sounds like a jquery issue. Can you go to http://supportdetails.com/ and share the results? You can black out your IP

@RodolfoSilva
Copy link
Contributor

captura_de_tela-6

@Eonasdan
Copy link
Owner

with the exception of your browser and flash being out of date, the only difference is you're using Linux vs me using Win 8

@phaidon
Copy link

phaidon commented Jun 27, 2014

I still can not reproduce it:
Chrome 35.0.1916.153
MacOsX

Do you have special addons activated (prefill form or something like that)?

@Eonasdan
Copy link
Owner

@phaidon makes a good point. Can you try it in incognito mode and/or another browser?

@RodolfoSilva
Copy link
Contributor

Updated the browser and the problem continues. I tried at the same with Firefox and forward.

All special addons are disabled.

@Eonasdan
Copy link
Owner

Eonasdan commented Jul 9, 2014

I'm making this the primary issue for this problem and merge all these dups together.

I still cannot reproduce the problem.

Some have suggested this is a problem with timezones and DST.

Please provide the TZ you're trying this from

@Eonasdan
Copy link
Owner

Eonasdan commented Jul 9, 2014

have any of you tried this with moment 2.7?

@everaldo
Copy link

everaldo commented Jul 9, 2014

Unfortunately, I hadn´t tried yet. My project is stalled. :(

@lucasbento
Copy link

I wasn't able to reproduce his issue either.
I guess the problem that I had in #324 is different since moment.js crashes and it freezes the whole browser.

@Eonasdan
Copy link
Owner

@lucasbsilva what version of moment have you tried?

@lucasbento
Copy link

@Eonasdan the same one used in your demo website, 2.5.1, it also occurs in there.

@Eonasdan
Copy link
Owner

can you try 2.7 straight from their site?

@lucasbento
Copy link

It's working normally now, thank you! :)

@webjoel
Copy link

webjoel commented Jul 10, 2014

@Eonasdan Apparently, the users complained that corresponds to the same timezone (America / Sao_Paulo -03:00). I am using the component together with momentjs version 2.5.1. I will try now with 2.7.

@Eonasdan
Copy link
Owner

I just merged a PR that changed the fillDate function to use moment.utc that is supposed to fix an issue with duplicate dates. This might have fixed this issue, please check the latest (non-minified) source to see if this has fixed your issue and didn't create any new issues.

@webjoel
Copy link

webjoel commented Jul 22, 2014

Not resolved.

@leo-mck
Copy link

leo-mck commented Jul 22, 2014

For me the problem still happen on the demo site If I navigate to october, the browser tab freeze. But the latest source works fine. The problem has to do with DST and probably this: https://code.google.com/p/v8/issues/detail?id=3116

My TZ is too "America/Sao_Paulo -03:00".

@nikoskalogridis
Copy link
Contributor

is this resolved ?

@webjoel
Copy link

webjoel commented Aug 6, 2014

For me it only works with the following versions:

bootstrap-datetimepicker: 2.1.32
moment: 2.7.0

@nikoskalogridis
Copy link
Contributor

so the code from development branch and moment 2.8.1 is still not working?

@webjoel
Copy link

webjoel commented Aug 6, 2014

Sorry, in version 2.8.x I have not tested yet, I want to test?

@nikoskalogridis
Copy link
Contributor

yes please (remember to use the source version as the minified file is not updated on development branch)

@webjoel
Copy link

webjoel commented Aug 6, 2014

Ok, I will perform the tests and when you finish, I'll post the results.

@webjoel
Copy link

webjoel commented Aug 6, 2014

Tested every year and months discussed above and the problem was solved with the following versions:

bootstrap-datetimepicker: 3.0.2
moment: 2.8.1

But the time is adding one hour, why?

@nikoskalogridis
Copy link
Contributor

Please check with the current version on the development branch the /src/js/bootstrap-datetimepicker.js and moment 2.8.1

@webjoel
Copy link

webjoel commented Aug 6, 2014

Ok, tested and is working well. ;)

@webjoel
Copy link

webjoel commented Aug 6, 2014

With development branch the time is correct.

@webjoel
Copy link

webjoel commented Aug 6, 2014

However, this message is appearing in the console: Deprecation warning: moment.lang is deprecated. Use moment.locale instead.

@nikoskalogridis
Copy link
Contributor

Are you certain that you are using the latest source (not the minified version) from development branch?

@webjoel
Copy link

webjoel commented Aug 6, 2014

Yes I am using the development branch, the problem is in the file: bootstrap-datetimepicker.pt-BR

@webjoel
Copy link

webjoel commented Aug 6, 2014

Where is the folder "locales" in latest brach?

@Eonasdan
Copy link
Owner

Eonasdan commented Aug 6, 2014

The locales have been removed in favor of the locale files straight from moment

@webjoel
Copy link

webjoel commented Aug 6, 2014

ok,

In my file "bootstrap-datetimepicker.pt-BR.js", I change the line "return moment.lang('pt-br', {" to "return moment.locale('pt-br', {" and now it´s ok :)

it´s problem??

@webjoel
Copy link

webjoel commented Aug 6, 2014

I downloaded the "moment-with-locales.min" file and it worked correctly.

@webjoel
Copy link

webjoel commented Aug 6, 2014

Unfortunately, now my model is no longer being updated when changed the date / time ..: (

@webjoel
Copy link

webjoel commented Aug 6, 2014

I`am use this directive angular:

angularModule.directive('dateTimePicker', function($filter) {

    return {
        require: 'ngModel',
        link: function(scope, elem, attrs, ctrl) {

            var formatBra = 'dd/MM/yyyy HH:mm';
            var formatEng = 'yyyy-MM-ddTHH:mm';
            var date = true;
            var time = true;
            var opt = { language: 'pt-BR', pickDate: true, pickTime: true };
            var type = attrs.dateTimePicker;

            if (type == 'date') {
                formatBra = formatBra.substring(0,10);
                formatEng = formatEng.substring(0,10);
                opt = { language: 'pt-BR', pickDate: true, pickTime: false };
                type = '-' + type;
            } else if (type == 'time') {
                formatBra = formatBra.substring(11);
                formatEng = formatEng.substring(11);
                opt = { language: 'pt-BR', pickDate: false, pickTime: true };
                type = '-' + type;
            }

            ctrl.$formatters.unshift(function(modelValue) {

                return $filter('date')(modelValue, formatBra);
            });

            ctrl.$parsers.unshift(function(viewValue) {

                return $filter('date')(viewValue, formatEng);
            });

            var dtp = $('.datetimepicker' + type).datetimepicker( opt );

            dtp.on('change.dp', function(e) {

                if (e.date != undefined) {

                    ctrl.$setViewValue(e.date._d);
                    scope.$apply();
                }
            });
        }
    }
});

@nikoskalogridis
Copy link
Contributor

dtp.on('change.dp'... -> dtp.on('dp.change'...

@nikoskalogridis
Copy link
Contributor

if you still has problems please open a new issue

@webjoel
Copy link

webjoel commented Aug 6, 2014

\o/ Resolved!! Tnank´s!!

kikonen pushed a commit to kikonen/bootstrap-datetimepicker that referenced this issue Jan 2, 2017
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.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants