-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Feature / RTL Support #454
Conversation
css/DayPicker.scss
Outdated
@@ -56,6 +56,12 @@ | |||
} | |||
} | |||
|
|||
.DayPicker__week-header--rtl { | |||
ul{ |
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.
needs a space before {
css/DayPickerNavigation.scss
Outdated
@@ -42,10 +42,20 @@ | |||
left: 22px; | |||
} | |||
|
|||
.DayPickerNavigation__prev--rtl{ // sag1v rtl |
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.
space before {
css/DayPickerNavigation.scss
Outdated
.DayPickerNavigation__next { | ||
right: 22px; | ||
} | ||
|
||
.DayPickerNavigation__next--rtl{ // sag1v rtl |
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.
space before {
css/DayPickerNavigation.scss
Outdated
@@ -42,10 +42,20 @@ | |||
left: 22px; | |||
} | |||
|
|||
.DayPickerNavigation__prev--rtl{ // sag1v rtl | |||
left: auto; | |||
right:22px |
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.
space after :
; missing a semicolon
css/DayPickerNavigation.scss
Outdated
.DayPickerNavigation__next { | ||
right: 22px; | ||
} | ||
|
||
.DayPickerNavigation__next--rtl{ // sag1v rtl | ||
right: auto; | ||
left:22px |
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.
space after :
; missing a semicolon
src/components/DateRangePicker.jsx
Outdated
@@ -195,14 +196,17 @@ export default class DateRangePicker extends React.Component { | |||
withPortal, | |||
withFullScreenPortal, | |||
anchorDirection, | |||
isRTL // sag1v rtl |
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.
missing a trailing comma
src/components/DateRangePicker.jsx
Outdated
@@ -86,6 +86,7 @@ const defaultProps = { | |||
displayFormat: () => moment.localeData().longDateFormat('L'), | |||
monthFormat: 'MMMM YYYY', | |||
phrases: DateRangePickerPhrases, | |||
isRTL:false, // sag1v rtl |
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.
needs a space after :
src/components/DateRangePicker.jsx
Outdated
const dayPickerClassName = cx('DateRangePicker__picker', { | ||
'DateRangePicker__picker--direction-left': anchorDirection === ANCHOR_LEFT, | ||
'DateRangePicker__picker--direction-right': anchorDirection === ANCHOR_RIGHT, | ||
'DateRangePicker__picker--horizontal': orientation === HORIZONTAL_ORIENTATION, | ||
'DateRangePicker__picker--vertical': orientation === VERTICAL_ORIENTATION, | ||
'DateRangePicker__picker--portal': withPortal || withFullScreenPortal, | ||
'DateRangePicker__picker--full-screen-portal': withFullScreenPortal, | ||
'DateRangePicker__picker--rtl' : isRTL, // sag1v rtl |
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.
should not have a space before :
src/components/DayPicker.jsx
Outdated
@@ -621,7 +631,7 @@ export default class DayPicker extends React.Component { | |||
|
|||
return ( | |||
<div | |||
className="DayPicker__week-header" | |||
className={cx("DayPicker__week-header", { "DayPicker__week-header--rtl": isRTL })} // sag1v rtl |
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.
these double quotes need to be single quotes when in a JS context (previously it was in a jsx context, which requires double)
return ( // sag1v rtl | ||
<div className={navClassNames}> | ||
{!isVerticalScrollable && !isRTL ? prevButton() : nextButton()} | ||
{!isRTL ? nextButton() : prevButton()} |
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.
instead of making these functions that are only executed conditionally, let's use the typical jsx pattern if isRTL && nextButtonElements
etc.
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.
but they render in different order
I'm not sure why tests aren't running, but if you rebase latest master and force push i expect them to run. |
@ljharb |
@sag1v assuming |
@ljharb
obviously
|
@sag1v you need to add one - i think the command is |
@ljharb ok, after adding the source and running the command again i get this:
|
I'm not sure about the "permission denied", but that means there's conflicts, and you'll need to manually resolve them. |
@ljharb i think i resolved them but it still showing that there are conflicts here |
@ljharb does it look ok now? |
There's still a merge commit on the end; you'll want to avoid clicking "update branch" on the github UI because it means you need another rebase. |
@ljharb seems that i cant merge nore push because i need to merge. Im on a loop lol 😂 |
You need to fetch from source, rebase locally onto source/master, and then force push. No merging or your local master involved. |
@ljharb can you please provide a set of commands to do what you suggested? |
#454 (comment) has them. |
@ljharb tried it and getting this (i dont know why the difference all of a sudden):
|
@ljharb i think i managed to resolve all conflicts. now when i run the commands you mentioned i get this:
and i executed this as well: |
hmm tests failing again |
@sag1v the idea is that you never ever ever run |
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.
Looking much better! A few more comments, plus it'll need extensive tests.
src/components/DayPicker.jsx
Outdated
@@ -37,6 +37,7 @@ const MONTH_PADDING = 23; | |||
const DAY_PICKER_PADDING = 9; | |||
const PREV_TRANSITION = 'prev'; | |||
const NEXT_TRANSITION = 'next'; | |||
const RTL_TRANSLATION_VALUE = -295; |
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.
where does this number come from?
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.
hmm i was sure i changed that magic number. anyway it should get the negative size of getCalendarMonthWidth()
.
src/components/DayPicker.jsx
Outdated
@@ -80,7 +84,7 @@ export const defaultProps = { | |||
numberOfMonths: 2, | |||
orientation: HORIZONTAL_ORIENTATION, | |||
withPortal: false, | |||
onOutsideClick() {}, | |||
onOutsideClick() { }, |
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.
please revert the addition of a space inside the body of these empty methods, throughout the file
{navPrevIcon} | ||
</button> | ||
)} | ||
const prevButton = () => { |
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.
i still don't think these should be functions; they should be conditionally rendered inline instead.
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.
There's an excessive amount of extra whitespace added in this diff; i've tried to comment on all of them, but please in general ensure that there is never more than one blank line in a row, and that blank lines aren't added arbitrarily.
examples/SingleDatePickerWrapper.jsx
Outdated
@@ -22,6 +22,10 @@ const propTypes = { | |||
'focused', | |||
'onFocusChange', | |||
]), | |||
|
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.
there shouldn't be two empty lines next to each other; let's collapse this to one
examples/DateRangePickerWrapper.jsx
Outdated
@@ -77,6 +80,10 @@ const defaultProps = { | |||
displayFormat: () => moment.localeData().longDateFormat('L'), | |||
monthFormat: 'MMMM YYYY', | |||
phrases: DateRangePickerPhrases, | |||
|
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.
there shouldn't be two empty lines next to each other; let's collapse this to one
examples/SingleDatePickerWrapper.jsx
Outdated
|
||
isRTL: false, | ||
|
||
|
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.
there shouldn't be any empty lines inside curly braces; please remove these two
examples/SingleDatePickerWrapper.jsx
Outdated
@@ -65,6 +69,10 @@ const defaultProps = { | |||
displayFormat: () => moment.localeData().longDateFormat('L'), | |||
monthFormat: 'MMMM YYYY', | |||
phrases: SingleDatePickerPhrases, | |||
|
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 line should be removed; properties in object literals aren't padded by blank lines.
src/components/DateRangePicker.jsx
Outdated
@@ -88,6 +88,9 @@ const defaultProps = { | |||
displayFormat: () => moment.localeData().longDateFormat('L'), | |||
monthFormat: 'MMMM YYYY', | |||
phrases: DateRangePickerPhrases, | |||
|
|||
isRTL: false, | |||
|
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.
remove this line
examples/DateRangePickerWrapper.jsx
Outdated
@@ -25,6 +25,9 @@ const propTypes = { | |||
'focusedInput', | |||
'onFocusChange', | |||
]), | |||
|
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.
remove this line
examples/DateRangePickerWrapper.jsx
Outdated
|
||
|
||
isRTL: false, | ||
|
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.
remove this line
|
||
|
||
isRTL: PropTypes.bool, | ||
|
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.
remove this line
@@ -77,6 +81,9 @@ const defaultProps = { | |||
|
|||
// internationalization | |||
monthFormat: 'MMMM YYYY', | |||
|
|||
isRTL: false, | |||
|
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.
remove this line
examples/SingleDatePickerWrapper.jsx
Outdated
|
||
|
||
isRTL: PropTypes.bool, | ||
|
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.
remove this line
src/components/DayPicker.jsx
Outdated
const convertedTranslationValueRTL = (this.dayPickerWidth + this.state.translationValueRTL); | ||
let translationValue = this.props.isRTL ? convertedTranslationValueRTL : -this.dayPickerWidth; | ||
|
||
if(this.isVertical()){ |
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.
always a space after if
, always a space between )
and {
.
src/components/DayPicker.jsx
Outdated
let translationValue = this.props.isRTL ? convertedTranslationValueRTL : -this.dayPickerWidth; | ||
|
||
if(this.isVertical()){ | ||
translationValue = this.getMonthHeightByIndex(1) * -1 |
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.
missing a semicolon
@majapw Hi, any idea when will it be merged to the master? we want to do an npm update on react-dates in our project instead of using my version :) |
Taking a look at this today! :) Hope to get it merged asap. |
Awesome news, Yippee ki-yay! :) |
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.
There are a handful of changes I'd like to see before this is ready, but overall looking good.
src/components/DayPicker.jsx
Outdated
if (e) e.preventDefault(); | ||
|
||
if (this.props.onPrevMonthClick) { | ||
this.props.onPrevMonthClick(e); | ||
} | ||
|
||
const translationValue = | ||
this.isVertical() ? this.getMonthHeightByIndex(0) : this.dayPickerWidth; | ||
let translationValue = this.isVertical() ? this.getMonthHeightByIndex(0) : this.dayPickerWidth; |
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.
Can you make this and the conditional in onNextMonthClick
match? I don't really care what pattern you use, but it'd be nice if they were the same.
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.
you mean the extra const
in the onNextMonthClick
?
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.
More that this function does:
let translationValue = this.isVertical() ? this.getMonthHeightByIndex(0) : this.dayPickerWidth;
if (isRTL && this.isHorizontal()) {
translationValue = translationValueRTL - this.dayPickerWidth;
}
and onNextMonthClick
does
const convertedTranslationValueRTL = this.dayPickerWidth + this.state.translationValueRTL;
let translationValue = this.props.isRTL ? convertedTranslationValueRTL : -this.dayPickerWidth;
if (this.isVertical()) {
translationValue = -this.getMonthHeightByIndex(1);
}
These two sets of ternaries/conditionals do pretty much the exact same thing, but look totally different. They should look the same. You could accomplish this by changing onNextMonthClick
to have:
let translationValue = this.isVertical() ? -this.getMonthHeightByIndex(1) : -this.dayPickerWidth;
if (isRTL && this.isHorizontal()) {
translationValue = this.dayPickerWidth + this.state.translationValueRTL;
}
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.
yeah remember i had to change it because of the "maximum line length of 100" lint rule. it exceeds it by 2 chars.
The difference between this and the other block from onPrevMonthClick
is the -
chars on this line:
let translationValue = this.isVertical() ? -this.getMonthHeightByIndex(1) : -this.dayPickerWidth;
should i disable this rule for this line only?
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.
you know what forget the rule disabling. i'll just add a new line (i've seen you guys doing it before i think, so i guess that's legit by you)
examples/DateRangePickerWrapper.jsx
Outdated
@@ -17,6 +17,7 @@ const propTypes = { | |||
autoFocusEndDate: PropTypes.bool, | |||
initialStartDate: momentPropTypes.momentObj, | |||
initialEndDate: momentPropTypes.momentObj, | |||
isRTL: PropTypes.bool, |
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.
I don't think this needs to go here since it probably should be added to DateRangePickerShape
examples/SingleDatePickerWrapper.jsx
Outdated
@@ -15,6 +15,7 @@ const propTypes = { | |||
// example props for the demo | |||
autoFocus: PropTypes.bool, | |||
initialDate: momentPropTypes.momentObj, | |||
isRTL: PropTypes.bool, |
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.
Same. This should be a part of SingleDatePickerShape so you don't need to add it explicitly to the wrapper proptypes
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.
I think you removed the defaultProp instead of the propType declaration in this file by accident!
src/components/CalendarMonth.jsx
Outdated
@@ -43,6 +43,8 @@ const propTypes = forbidExtraProps({ | |||
// i18n | |||
monthFormat: PropTypes.string, | |||
phrases: PropTypes.shape(getPhrasePropTypes(CalendarDayPhrases)), | |||
|
|||
isRTL: PropTypes.bool, |
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 never gets used?
src/components/DayPicker.jsx
Outdated
@@ -516,7 +535,7 @@ export default class DayPicker extends React.Component { | |||
this.setState({ | |||
currentMonth: newMonth, | |||
monthTransition: null, | |||
translationValue: 0, | |||
translationValue: (this.props.isRTL && this.isHorizontal()) ? translationValueRTL : 0, |
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.
I don't know that this should be non-zero here even if it is RTL since this is after the transition.
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.
when it's 0
on RTL the transition to the right is super fast and the transition to the left is cluttering a bit (not smooth)
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.
That's ... surprising. Let me look into that.
src/shapes/DateRangePickerShape.js
Outdated
@@ -66,4 +66,6 @@ export default { | |||
displayFormat: PropTypes.oneOfType([PropTypes.string, PropTypes.func]), | |||
monthFormat: PropTypes.string, | |||
phrases: PropTypes.shape(getPhrasePropTypes(DateRangePickerPhrases)), | |||
|
|||
isRTL: PropTypes.bool, |
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.
Should add this prop to SingleDatePickerShape
as well.
@@ -30,6 +30,11 @@ describe('DateRangePicker', () => { | |||
expect(wrapper.find('.DateRangePicker__picker')).to.have.length(1); | |||
}); | |||
|
|||
it('renders .DateRangePicker__picker--rtl class', () => { |
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.
test for SingleDatePicker as well?
@majapw what about adding the |
We probably want that as well! (adding it to the README I mean) |
@majapw on what section? i was thinking maybe under this section |
@majapw i think i'm done |
@sag1v it'll need another rebase whenever you can too :-) |
css/SingleDatePicker.scss
Outdated
@@ -12,6 +12,10 @@ | |||
top: $react-dates-spacing-vertical-picker; | |||
} | |||
|
|||
.SingleDatePicker__picker--rtl{ |
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.
nit: space after the class name
css/SingleDatePickerInput.scss
Outdated
@@ -4,7 +4,9 @@ | |||
background-color: $react-dates-color-white; | |||
border: 1px solid $react-dates-color-border; | |||
} | |||
|
|||
.SingleDatePickerInput--rtl{ |
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.
nit: space after the class name
css/SingleDatePickerInput.scss
Outdated
|
||
.SingleDatePickerInput--rtl{ | ||
direction: rtl; | ||
} |
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.
empty line between the class declarations?
examples/SingleDatePickerWrapper.jsx
Outdated
@@ -15,6 +15,7 @@ const propTypes = { | |||
// example props for the demo | |||
autoFocus: PropTypes.bool, | |||
initialDate: momentPropTypes.momentObj, | |||
isRTL: PropTypes.bool, |
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.
I think you removed the defaultProp instead of the propType declaration in this file by accident!
src/components/CalendarMonth.jsx
Outdated
@@ -63,6 +64,7 @@ const defaultProps = { | |||
// i18n | |||
monthFormat: 'MMMM YYYY', // english locale | |||
phrases: CalendarDayPhrases, | |||
|
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.
Unnecessary line additions. We can probs checkout the master CalendarMonth
version to avoid this
src/components/CalendarMonthGrid.jsx
Outdated
@@ -46,6 +46,7 @@ const propTypes = forbidExtraProps({ | |||
// i18n | |||
monthFormat: PropTypes.string, | |||
phrases: PropTypes.shape(getPhrasePropTypes(CalendarDayPhrases)), | |||
|
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.
Same here. Let's check out master's CalendarMonthGrid
to avoid this diff
src/components/DayPicker.jsx
Outdated
@@ -516,7 +535,7 @@ export default class DayPicker extends React.Component { | |||
this.setState({ | |||
currentMonth: newMonth, | |||
monthTransition: null, | |||
translationValue: 0, | |||
translationValue: (this.props.isRTL && this.isHorizontal()) ? translationValueRTL : 0, |
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.
That's ... surprising. Let me look into that.
Hi @sag1v, this is looking close to ready to go! I'm going to check out the branch and play around with it a bit. Can you squash down your commits into 1? |
@majapw sure, how do i do that? |
I've helped to address some of my comments! This is pretty much ready to go right now so maybe @ljharb can take a look? I was also thinking that part of the reason we have to do some weird calculations in the |
Oh also @sag1v, sorry I just aggressively squashed for you... but in the future you can do: |
1 similar comment
this.hasSetInitialVisibleMonth = !props.hidden; | ||
this.state = { | ||
currentMonth, | ||
monthTransition: null, | ||
translationValue: 0, |
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.
good catch
@@ -60,6 +60,7 @@ const defaultProps = { | |||
renderCalendarInfo: null, | |||
hideKeyboardShortcutsPanel: false, | |||
daySize: DAY_SIZE, | |||
isRTL: false, |
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.
where's the propType for this?
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.
It's in SingleDatePickerShape
@@ -52,6 +53,8 @@ const propTypes = forbidExtraProps({ | |||
|
|||
// i18n | |||
phrases: PropTypes.shape(getPhrasePropTypes(DateRangePickerInputPhrases)), | |||
|
|||
isRTL: PropTypes.bool, |
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.
does this still belong here?
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.
Yes! Wait why wouldn't it?
@@ -58,6 +58,8 @@ const propTypes = forbidExtraProps({ | |||
|
|||
// i18n | |||
phrases: PropTypes.shape(getPhrasePropTypes(DateRangePickerInputPhrases)), | |||
|
|||
isRTL: PropTypes.bool, |
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.
does this still belong here?
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.
The Input needs the isRTL
prop to select the correct direction of decorative arrow.
@@ -50,6 +50,7 @@ const propTypes = forbidExtraProps({ | |||
renderCalendarInfo: PropTypes.func, | |||
hideKeyboardShortcutsPanel: PropTypes.bool, | |||
daySize: nonNegativeInteger, | |||
isRTL: PropTypes.bool, |
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.
does this still belong here?
@@ -27,6 +27,8 @@ const propTypes = forbidExtraProps({ | |||
|
|||
// internationalization | |||
phrases: PropTypes.shape(getPhrasePropTypes(DayPickerNavigationPhrases)), | |||
|
|||
isRTL: PropTypes.bool, |
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.
does this still belong here?
@@ -66,6 +66,8 @@ const propTypes = forbidExtraProps({ | |||
// i18n | |||
monthFormat: PropTypes.string, | |||
phrases: PropTypes.shape(getPhrasePropTypes(DayPickerPhrases)), | |||
|
|||
isRTL: PropTypes.bool, |
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.
does this still belong here?
@@ -22,7 +22,7 @@ const propTypes = forbidExtraProps({ | |||
showCaret: PropTypes.bool, | |||
showClearDate: PropTypes.bool, | |||
customCloseIcon: PropTypes.node, | |||
|
|||
isRTL: PropTypes.bool, |
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.
does this still belong here?
Thanks for your contribution @sag1v! :D Always great to work with other folks to make the library better. :) I'm doing a release of v10.2.0 right now, so it should be available in about 15 minutes :D |
All set! v10.2.0 has been released! :) |
the branch is in your fork, not this repo, so go nuts! :-D |
I've added support for RTL languages.
The consumer should supply a prop
isRTL : bool
.I've also added example stories to see it in action (on both horizontal and vertical mode ).
I haven't created tests for it yet as i'm not that familiar with those kind of tests, it will be nice to get help with those tests if you think is needed.