-
Notifications
You must be signed in to change notification settings - Fork 6.8k
docs(datepicker): datepicker overview demos #5273
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
Conversation
There was a problem hiding this 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 { |
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jelbourn Done :)
# Conflicts: # src/material-examples/example-module.ts
<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 |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah! Got it! Done :)
I addressed the items requested, ready for review. |
export class DatepickerFilterExample { | ||
myFilter = (d: Date): boolean => { | ||
const day = d.getDay(); | ||
return day !== 0 && day !== 6; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
There was a problem hiding this 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
Done :) |
* 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
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Add datepicker demos for: