-
-
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
Set input value to use ISO format by default #229
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, but it could use some tests
I just realized this won't actually work for custom display formats. |
7db7252
to
54af822
Compare
@ljharb let's try again. Lol. This is messier, but also less broken. PTAL? |
focused, | ||
showCaret, | ||
onFocus, | ||
disabled, | ||
required, | ||
} = this.props; | ||
|
||
const value = dateValue || dateString; | ||
const displayText = displayValue || inputValue || dateString || placeholder; |
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 also need an || ''
at the end?
yo dawg, i heard you like defaults
@@ -23,7 +23,9 @@ const propTypes = { | |||
onClearDates: PropTypes.func, | |||
|
|||
startDate: PropTypes.string, | |||
startDateValue: PropTypes.string, |
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 need defaultProps (the linter checks this now)
54af822
to
7eb9654
Compare
If we don't add a layer of abstraction to format the date client side, the input value will be submitted directly to the server. As a result, I think we should not be using the display format but rather a standardized ISO-8601 format.
to: @jeffsee55 @airbnb/webinfra