10 examples of 'disable previous date in bootstrap datepicker' in JavaScript

Every line of 'disable previous date in bootstrap datepicker' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your JavaScript code is secure.

All examples are scanned by Snyk Code

By copying the Snyk Code Snippets you agree to
this disclaimer
186previousDisabled(): boolean {
187 return this.minDate && isSameMonth(this.current, this.minDate);
188}
Important

Use secure code every time

Secure your code as it's written. Use Snyk Code to scan source code in minutes – no build needed – and fix issues immediately. Enable Snyk Code

297get isDisabled(): boolean {
298 const { maxYear } = this.props;
299 return maxYear !== undefined && this.props.fromYear + CELL_COUNT > maxYear;
300}
127isPreviousDisabled(): boolean {
128
129 const min = this.datepicker.min$.value;
130
131 if (min && this._isBeforeView(min)) {
132 return true;
133 }
134
135 // if we are not in range mode or there are no disabled items then we can navigate back
136 if (!this._isRangeMode || this._rangeStart && this._rangeEnd ||
137 !this._rangeStart && !this._rangeEnd || this._isRangeStart
138 || this._isRangeEnd && this._rangeEnd) {
139 return false;
140 }
141
142 if (this._isBeforeView(this._rangeStart)) {
143 return true;
144 }
145
146 return false;
147}
297prevDay() {
298 if (this.selected) {
299 this.selected = this._dateAdapter.addCalendarDays(this.selected, -1);
300 this.selectedChanged.next(this.selected);
301 }
302}
205nextDay() {
206 if (this.selected) {
207 this.selected = this.dateAdapter.addCalendarDays(this.selected, 1);
208 this.selectedChanged.next(this.selected);
209
210 }
211}
95prevMonth() {
96 this.updateState(() => {
97 const { date } = this.state
98 const { month, year } = deconstructDate(date)
99
100 if (month == 0) {
101 date.setFullYear(year - 1)
102 date.setMonth(11)
103 } else {
104 date.setMonth(month - 1)
105 }
106 })
107}
293prevMonth() {
294 const viewDate = this.viewDate || new CalendarDate();
295 if (this.showYearPick) {
296 this.viewDate = viewDate.addYears(-1);
297 } else {
298 this.viewDate = viewDate.incrementMonths(-1);
299 }
300}
107isDisabled(value: boolean): Action {
108 return {
109 type: BsDatepickerActions.SET_IS_DISABLED,
110 payload: value
111 };
112}
290nextDay() {
291 if (this.selected) {
292 this.selected = this._dateAdapter.addCalendarDays(this.selected, 1);
293 this.selectedChanged.next(this.selected);
294 }
295}
226_nextEnabled(): boolean {
227 return !this.maxDate || !this._isSameView(this._activeDate, this.maxDate);
228}

Related snippets