Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Eonasdan committed Jul 2, 2018
2 parents 7b6a3c6 + f6f3b46 commit b83f657
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 6 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
"files": [
"build",
"src/js/**/*.js",
"src/scss/**/*.scss",
"Gruntfile.js"
]
}
3 changes: 2 additions & 1 deletion src/docs/Installing.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ Python package for Django: [Django Tempus Dominus](https://pypi.org/project/djan
3. [Full examples are available with Django Forms, Widgets, and Templates](https://pypi.org/project/django-tempus-dominus/).

### Angular Wrapper
Need new wrapper for this version.

Follow instructions at [ngx-tempusdominus-bootstrap](https://github.com/fetrarij/ngx-tempusdominus-bootstrap)

### Meteor.js

Expand Down
2 changes: 1 addition & 1 deletion src/docs/Options.md
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ Takes a `boolean` variable to set if the week numbers will appear to the left on
### viewMode

Default: 'days'
Accepts: 'decades','years','months','days'
Accepts: 'decades','years','months','days', 'times'

The default view to display when the picker is shown.

Expand Down
16 changes: 12 additions & 4 deletions src/js/tempusdominus-bootstrap-4.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,12 +158,20 @@ const TempusDominusBootstrap4 = ($ => { // eslint-disable-line no-unused-vars
}).append($('<span>').addClass(this._options.icons.today))));
}
if (!this._options.sideBySide && this._hasDate() && this._hasTime()) {
let title, icon;
if (this._options.viewMode === 'times') {
title = this._options.tooltips.selectDate;
icon = this._options.icons.date;
} else {
title = this._options.tooltips.selectTime;
icon = this._options.icons.time;
}
row.push($('<td>').append($('<a>').attr({
href: '#',
tabindex: '-1',
'data-action': 'togglePicker',
'title': this._options.tooltips.selectTime
}).append($('<span>').addClass(this._options.icons.time))));
'title': title
}).append($('<span>').addClass(icon))));
}
if (this._options.buttons.showClear) {
row.push($('<td>').append($('<a>').attr({
Expand Down Expand Up @@ -219,15 +227,15 @@ const TempusDominusBootstrap4 = ($ => { // eslint-disable-line no-unused-vars
}
if (this._hasDate()) {
content.append($('<li>').addClass(this._options.collapse && this._hasTime() ? 'collapse' : '')
.addClass((this._options.collapse && this._hasTime() && this._options.viewMode === 'time' ? '' : 'show'))
.addClass((this._options.collapse && this._hasTime() && this._options.viewMode === 'times' ? '' : 'show'))
.append(dateView));
}
if (this._options.toolbarPlacement === 'default') {
content.append(toolbar);
}
if (this._hasTime()) {
content.append($('<li>').addClass(this._options.collapse && this._hasDate() ? 'collapse' : '')
.addClass((this._options.collapse && this._hasDate() && this._options.viewMode === 'time' ? 'show' : ''))
.addClass((this._options.collapse && this._hasDate() && this._options.viewMode === 'times' ? 'show' : ''))
.append(timeView));
}
if (this._options.toolbarPlacement === 'bottom') {
Expand Down

0 comments on commit b83f657

Please sign in to comment.