From 7eb75fc11092ce7e11d713a20da7abd322103b64 Mon Sep 17 00:00:00 2001 From: Andrew Bythell Date: Fri, 6 Jul 2018 16:17:50 -0700 Subject: [PATCH] remove yearPicker when year=false --- js/bootstrap-material-datetimepicker.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/bootstrap-material-datetimepicker.js b/js/bootstrap-material-datetimepicker.js index e651a47..715e44f 100644 --- a/js/bootstrap-material-datetimepicker.js +++ b/js/bootstrap-material-datetimepicker.js @@ -819,7 +819,7 @@ var startOfYear = moment(date).locale(this.params.lang).startOf('year'); var endOfYear = moment(date).locale(this.params.lang).endOf('year'); - if (!this.isAfterMinDate(startOfYear, false, false)) + if (!this.isAfterMinDate(startOfYear, false, false) || !this.params.year) { this.$dtpElement.find('a.dtp-select-year-before').addClass('invisible'); } else @@ -827,7 +827,7 @@ this.$dtpElement.find('a.dtp-select-year-before').removeClass('invisible'); } - if (!this.isBeforeMaxDate(endOfYear, false, false)) + if (!this.isBeforeMaxDate(endOfYear, false, false) || !this.params.year) { this.$dtpElement.find('a.dtp-select-year-after').addClass('invisible'); } else