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

feat(datepicker): min & max dates + dateFilter #3556

Merged
merged 8 commits into from
Mar 14, 2017

Conversation

mmalerba
Copy link
Contributor

No description provided.

@mmalerba mmalerba requested review from jelbourn and kara March 10, 2017 19:54
@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Mar 10, 2017
Copy link
Contributor

@kara kara left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nits, apply merge label when ready

* @param max The maximum date
* @returns A new SimpleDate equal to this one clamped between the given min and max dates.
*/
clamp(min: SimpleDate, max: SimpleDate) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Return type?

/**
* A date representing the current period shown in the calendar. The current period is always
* normalized to the 1st of a month, this prevents date overflow issues (e.g. adding a month to
* January 31st and overflowing into March).
*/
get _currentPeriod() { return this._normalizedCurrentPeriod; }
set _currentPeriod(value: SimpleDate) {
this._normalizedCurrentPeriod = new SimpleDate(value.year, value.month, 1);
let clampedValue = value.clamp(this.minDate, this.maxDate);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: const? :D

let enabled = false;
for (let date = new SimpleDate(this.date.year, month, 1); date.month === month;
date = date.add({days: 1})) {
enabled = enabled || this.dateFilter(date);
Copy link
Contributor

@kara kara Mar 14, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you need the enabled || check? Looks like if it's enabled, it will break the loop anyway.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

derp ><

@mmalerba mmalerba merged commit f43df39 into angular:datepicker Mar 14, 2017
mmalerba added a commit that referenced this pull request Mar 17, 2017
* don't allow going past min/max date

* add back missing mdSuffix

* added date filtering logic

* added working date filter

* disabled style for prev/next buttons

* add unit tests

* fix lint

* address comments
mmalerba added a commit to mmalerba/components that referenced this pull request Mar 28, 2017
* don't allow going past min/max date

* add back missing mdSuffix

* added date filtering logic

* added working date filter

* disabled style for prev/next buttons

* add unit tests

* fix lint

* address comments
mmalerba added a commit that referenced this pull request Apr 14, 2017
* don't allow going past min/max date

* add back missing mdSuffix

* added date filtering logic

* added working date filter

* disabled style for prev/next buttons

* add unit tests

* fix lint

* address comments
mmalerba added a commit that referenced this pull request Apr 20, 2017
* don't allow going past min/max date

* add back missing mdSuffix

* added date filtering logic

* added working date filter

* disabled style for prev/next buttons

* add unit tests

* fix lint

* address comments
mmalerba added a commit that referenced this pull request Apr 29, 2017
* don't allow going past min/max date

* add back missing mdSuffix

* added date filtering logic

* added working date filter

* disabled style for prev/next buttons

* add unit tests

* fix lint

* address comments
mmalerba added a commit that referenced this pull request May 5, 2017
* don't allow going past min/max date

* add back missing mdSuffix

* added date filtering logic

* added working date filter

* disabled style for prev/next buttons

* add unit tests

* fix lint

* address comments
mmalerba added a commit that referenced this pull request May 9, 2017
* don't allow going past min/max date

* add back missing mdSuffix

* added date filtering logic

* added working date filter

* disabled style for prev/next buttons

* add unit tests

* fix lint

* address comments
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla: yes PR author has agreed to Google's Contributor License Agreement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants