Skip to content
This repository was archived by the owner on May 29, 2019. It is now read-only.
This repository was archived by the owner on May 29, 2019. It is now read-only.

datepicker-popup: Cannot change maxDate and minDate option on the fly #6376

@wbarnie

Description

@wbarnie

Bug description: Cannot change maxDate and minDate option on the fly

I have page with 2 date pickers, start date and end date. Start date can be min date today max date today plus 90 days. End date min date is start date plus 1 hour and max date is start date plus 30. o have a structure and initially set it as follows:

maxDateSeed = new Date();
maxDateSeed.setDate(maxDateSeed.getDate() + 30);
var minDateSeed = new Date();
minDateSeed.setHours(minDateSeed.getHours() + 1);

$scope.endDateOptions = {
minDate: minDateSeed,
maxDate: maxDateSeed
};
$scope.endTimeOptions = {
minuteStep: 5
};

When the begin date changes, i do the following:

var defaultDate;
var minDate;
var maxDate;

     maxDate = new Date($scope.schedule.start_date);
      minDate = new Date($scope.schedule.start_date);
      defaultDate = new Date($scope.schedule.start_date);

minDate.setHours(minDate.getHours() + 1);

    defaultDate.setDate(defaultDate.getDate() + 3);

    maxDate.setDate(maxDate.getDate() + 30);
    $scope.endDateOptions.minDate = minDate;
    $scope.endDateOptions.maxDate = maxDate;

The correct date is displayed but the allowable range is wrong it is still the original date range. How can i change maxDate and minDate option on the fly?

here is a url to a plunker example that some else had the same issue. This example was supposed to show how this work but it does not work.

Version of Angular: ~1.4.0
UIBS: ~2.4.0
Bootstrap: ~3.3.4

Angular:

UIBS:

Bootstrap:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions