Skip to content

Conversation

amcdnl
Copy link
Contributor

@amcdnl amcdnl commented Jun 21, 2017

Add datepicker demos for:

  • Overview
  • Date Min/Max Validation
  • Date Filter Validation
  • API Opening
  • Touch

@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Jun 21, 2017
@amcdnl amcdnl requested a review from jelbourn June 22, 2017 23:03
@jelbourn jelbourn requested a review from mmalerba June 23, 2017 19:03
Copy link
Member

@jelbourn jelbourn left a comment

Choose a reason for hiding this comment

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

LGTM, @mmalerba should also take a look

templateUrl: 'datepicker-api-example.html',
styleUrls: ['datepicker-api-example.css'],
})
export class DatepickerAPIExample {
Copy link
Member

Choose a reason for hiding this comment

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

DatepickerApiExample (acronyms are camelCased too)

Copy link
Contributor Author

@amcdnl amcdnl Jun 24, 2017

Choose a reason for hiding this comment

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

@jelbourn Done :)

<input mdInput [mdDatepicker]="picker" placeholder="Choose a date">
</md-input-container>
<md-datepicker #picker></md-datepicker>
<button md-raised-button (click)="picker.open()">Open</button> No newline at end of file
Copy link
Contributor

Choose a reason for hiding this comment

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

a number of files are missing newline at end, you should configure your editor to insert it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done.

styleUrls: ['datepicker-filter-example.css'],
})
export class DatepickerFilterExample {
myFilter = (d: Date) => d.getFullYear() > 2017;
Copy link
Contributor

Choose a reason for hiding this comment

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

this could just be accomplished with min, i would use an example that illustrates why you would actually use filter (e.g. disabled odd dates)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ya, I have a example for min/max, this is to demonstrate filters.

Copy link
Member

Choose a reason for hiding this comment

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

Miles means that the example for filtering should show something else (e.g., filter out weekends).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah! Got it! Done :)

@amcdnl
Copy link
Contributor Author

amcdnl commented Jun 27, 2017

I addressed the items requested, ready for review.

export class DatepickerFilterExample {
myFilter = (d: Date): boolean => {
const day = d.getDay();
return day !== 0 && day !== 6;
Copy link
Member

Choose a reason for hiding this comment

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

Would be good to add a comment like

// Prevent Saturday and Sunday from being selected.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

Copy link
Member

@jelbourn jelbourn left a comment

Choose a reason for hiding this comment

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

LGTM sans a couple lint errors. You can add the merge-ready label when those are fixed

@amcdnl amcdnl added the action: merge The PR is ready for merge by the caretaker label Jun 29, 2017
@amcdnl
Copy link
Contributor Author

amcdnl commented Jun 29, 2017

Done :)

@mmalerba mmalerba merged commit 17d6346 into angular:master Jul 5, 2017
@amcdnl amcdnl deleted the datepicker-demos branch July 6, 2017 12:36
amcdnl added a commit to amcdnl/material2 that referenced this pull request Jul 8, 2017
* docs(datepicker): datepicker overview demos

* chore(*): rename `DatePickerAPIExample` to `DatepickerApiExample`

* chore(*): files end w/ new lines

* chore(demo): update date filter demo to exclude weekends

* docs(datepicker): add comments to filter

* chore(lint): fix lint errors
@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

action: merge The PR is ready for merge by the caretaker 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