From efb9b5285deb5f3021e2c881858377f631bd424c Mon Sep 17 00:00:00 2001 From: JaHicks Date: Tue, 16 Feb 2016 12:15:50 +0000 Subject: [PATCH] Fix prev & next buttons on initial load The previous and next buttons currently do not work when the widget is initially loaded. This is caused when the startView option comes through as a string and the switch case for enabling these buttons is skipped. This fix ensures the startView option is interpreted as an integer. --- datetimewidget/static/js/bootstrap-datetimepicker.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/datetimewidget/static/js/bootstrap-datetimepicker.js b/datetimewidget/static/js/bootstrap-datetimepicker.js index 9ba9888..1197ed9 100644 --- a/datetimewidget/static/js/bootstrap-datetimepicker.js +++ b/datetimewidget/static/js/bootstrap-datetimepicker.js @@ -122,7 +122,7 @@ this.startViewMode = 2; if ('startView' in options) { - this.startViewMode = options.startView; + this.startViewMode = parseInt(options.startView); } else if ('startView' in this.element.data()) { this.startViewMode = this.element.data('start-view'); }