Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems with minimum configuration in the date picker field [Regression] #439

Open
wants to merge 1 commit into
base: next
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/components/FormDatePicker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -254,11 +254,15 @@ export default {
@returns {boolean}
*/
checkMinMaxDateDisabled(date) {
date = moment(date.toLocaleDateString() + ' ' + moment().format('hh:mm:ss a')).toDate();
const minDate = !!this.minDate ? this.parseDateToDate(this.minDate) : "";
const maxDate = !!this.maxDate ? this.parseDateToDate(this.maxDate) : "";
// If minDate and maxDate are not defined, return. This would be the default case
if (minDate.length === 0 && maxDate.length === 0) return;
if (!!minDate && !!maxDate) {
if (this.config.dataFormat === 'date') {
return !(moment(date).isSameOrAfter(minDate, 'day') && moment(date).isSameOrBefore(this.maxDate, 'day'));
}
return !(date >= minDate && date <= maxDate);
}
// If minDate is defined but maxDate not defined, block the dates before minDate is defined
Expand Down
Loading