Skip to content
This repository was archived by the owner on Jun 5, 2020. It is now read-only.
This repository was archived by the owner on Jun 5, 2020. It is now read-only.

Start double picker as blank range #53

@windmaomao

Description

@windmaomao

I wasn't able to use double picker starting with a blank range, the problem is that if my data is { from: '', to: '' }, the picker will not let me select anything.

So I dug into the library and found if I can make the following change, it'll work. Basically, I just check is the model is empty.

          _withinLimits = function(day, month) {
            var withinLimits;
            withinLimits = true;
            if ($scope.model && $scope.model.isValid()) {
              if ($scope.before) {
                withinLimits && (withinLimits = day.isSameOrBefore($scope.before, 'day'));
              }
              if ($scope.after) {
                withinLimits && (withinLimits = day.isSameOrAfter($scope.after, 'day'));
              }
            }
            return withinLimits;
          };

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions