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

Default date prevents other dates from being chosen #55

Open
jmondo opened this issue Jun 16, 2015 · 4 comments
Open

Default date prevents other dates from being chosen #55

jmondo opened this issue Jun 16, 2015 · 4 comments

Comments

@jmondo
Copy link

jmondo commented Jun 16, 2015

I added 2 test cases to the 'Default date" describe block:

it("the ngModel value can be set to some time inside the default month", function() {
  $scope.defaultDate = '2014-11-10';
  $scope.date        = '2014-11-01';
  compile();

  expect($scope.date).to.equal('2014-11-01');
});
// pass

it("the ngModel value can be set to some time outside the default month", function() {
  $scope.defaultDate = '2014-11-10';
  $scope.date        = '2014-03-01';
  compile();

  expect($scope.date).to.equal('2014-03-01');
});
// AssertionError: expected undefined to equal '2014-03-01'

The first case passes, the second case fails. Is that the intended behavior?

In our app, we set the default date to next month, but once we did that users were unable to choose dates in this month or 2 months from now. Halp?

@gschammah
Copy link
Contributor

Hi there,

In the 2nd test, $scope.date should be 2014-03-01 and the displayed month should be November 2014. If that is not happening, then apparently we have a bug.

@jmondo
Copy link
Author

jmondo commented Jun 16, 2015

It is displaying the correct month (and you have other tests for that). The problem I'm having is unrelated to the display of the calendar.

My problem: When you set a default month and then you choose a date outside that month $scope.date gets set to undefined.

@gschammah
Copy link
Contributor

Ok, so then it's a bug that should be fixed. I will see if I have time to do it, but if you solved it, feel free to open a Pull Request

Thanks

@jmondo
Copy link
Author

jmondo commented Jun 16, 2015

Haven't solved it yet. Will definitely open a PR if I can solve. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants