Tempus-dominus: Problem with bootstrap 4.0 alpha 6

Created on 27 Jan 2017  路  9Comments  路  Source: Eonasdan/tempus-dominus

With bootstrap 4.0 alpha 6, if i set format to 'YYYY-MM-DD HH:mm', only the time part appears, date part not. In bootstrap 4.0 alpha 5, everything ok.

Most helpful comment

alpha 6 has replaced collapse in with collapse show.

Quick and dirty, but the following changes should work:

getTemplate:

            if (hasDate()) {
                content.append($('<li>').addClass((options.collapse && hasTime() ? 'collapse in' : '')).append(dateView));

Change to:

            if (hasDate()) {
                content.append($('<li>').addClass((options.collapse && hasTime() ? 'collapse show' : '')).append(dateView));
            }

togglePicker:

                    expanded = $parent.find('.in'),
                    closed = $parent.find('.collapse:not(.in)'),

.....

                    } else { // otherwise just toggle in class on the two views
                        expanded.removeClass('in');
                        closed.addClass('in');

Change to:

                    expanded = $parent.find('.show'),
                    closed = $parent.find('.collapse:not(.show)'),

.....

                    } else { // otherwise just toggle in class on the two views
                        expanded.removeClass('show');
                        closed.addClass('show');

All 9 comments

Why it is broke only in alpha 6, is there any quick fix anyone found to make it work

any temporary workaround for this ?

alpha 6 has replaced collapse in with collapse show.

Quick and dirty, but the following changes should work:

getTemplate:

            if (hasDate()) {
                content.append($('<li>').addClass((options.collapse && hasTime() ? 'collapse in' : '')).append(dateView));

Change to:

            if (hasDate()) {
                content.append($('<li>').addClass((options.collapse && hasTime() ? 'collapse show' : '')).append(dateView));
            }

togglePicker:

                    expanded = $parent.find('.in'),
                    closed = $parent.find('.collapse:not(.in)'),

.....

                    } else { // otherwise just toggle in class on the two views
                        expanded.removeClass('in');
                        closed.addClass('in');

Change to:

                    expanded = $parent.find('.show'),
                    closed = $parent.find('.collapse:not(.show)'),

.....

                    } else { // otherwise just toggle in class on the two views
                        expanded.removeClass('show');
                        closed.addClass('show');

Thank you, it works!

Thank you, @TommyDool

Is this fix merged to master ?

@midhunadarvin Hi quoting what @Eonasdan said on #1377

instead of forking this repo and trying to keep it update for bootstrap 4, you could help and contribute to https://github.com/tempusdominus/bootstrap-4

So no, this isn't gonna be merge to main, as this is not the repo for BS4 it's mainly for BS3

@TommyDool: Thanks you very much. Save my time.

@Eonasdan should this be close/lock as
1) Looks like solved
2) This widget is not developed for BS4, you have https://github.com/tempusdominus/bootstrap-4 for that
3) BS4 it's currently still on alpha so many things will change, probably, as happened between alpha 4 and alpha 6

Was this page helpful?
0 / 5 - 0 ratings