-
Notifications
You must be signed in to change notification settings - Fork 101
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(ui-calendar,ui-date-input): update DateInput2 api, add placeholder hint #1693
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.
other than a new unit test would be good for Calendar
, it looks good!
// this is needed for locales that doesn't use the latin script for numbers e.g.: arabic | ||
const yearNumber = Number( | ||
this.state.visibleMonth | ||
.clone() | ||
.locale('en') | ||
.subtract({ months: 1 }) | ||
.format('YYYY') | ||
) | ||
return ( | ||
!this.props.withYearPicker || | ||
(this.props.withYearPicker && | ||
Number( | ||
this.state.visibleMonth.clone().subtract({ months: 1 }).format('YYYY') | ||
) >= this.props.withYearPicker.startYear) | ||
yearNumber >= this.props.withYearPicker.startYear) | ||
) | ||
} | ||
|
||
get hasNextMonth() { | ||
// this is needed for locales that doesn't use the latin script for numbers e.g.: arabic | ||
const yearNumber = Number( | ||
this.state.visibleMonth | ||
.clone() | ||
.locale('en') | ||
.add({ months: 1 }) | ||
.format('YYYY') | ||
) |
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.
could you write a unit test for these?
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.
is it ok if it's added to the separate pr with all the other unit tests for dateinput2?
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.
yep, thats OK
v10 port of #1640