Skip to content
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

Merged
merged 1 commit into from
Jan 25, 2017

Conversation

majapw
Copy link
Collaborator

@majapw majapw commented Dec 21, 2016

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

@majapw majapw added the semver-major: breaking change A non-backwards-compatible change; anything that breaks code - including adding a peerDep. label Dec 21, 2016
@majapw majapw mentioned this pull request Dec 21, 2016
@majapw majapw requested a review from ljharb December 21, 2016 21:07
@coveralls
Copy link

Coverage Status

Coverage increased (+0.04%) to 86.541% when pulling 920a080 on maja-set-input-default-value-to-use-iso into fa3da30 on master.

Copy link
Member

@ljharb ljharb left a 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

@majapw
Copy link
Collaborator Author

majapw commented Jan 12, 2017

I just realized this won't actually work for custom display formats.

@majapw majapw force-pushed the maja-set-input-default-value-to-use-iso branch 2 times, most recently from 7db7252 to 54af822 Compare January 12, 2017 23:59
@majapw
Copy link
Collaborator Author

majapw commented Jan 13, 2017

@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;
Copy link
Member

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,
Copy link
Member

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)

@coveralls
Copy link

Coverage Status

Coverage increased (+0.06%) to 87.228% when pulling 54af822 on maja-set-input-default-value-to-use-iso into f931a82 on master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.06%) to 87.228% when pulling 54af822 on maja-set-input-default-value-to-use-iso into f931a82 on master.

@majapw majapw force-pushed the maja-set-input-default-value-to-use-iso branch from 54af822 to 7eb9654 Compare January 25, 2017 20:56
@coveralls
Copy link

Coverage Status

Coverage increased (+0.06%) to 87.228% when pulling 7eb9654 on maja-set-input-default-value-to-use-iso into d01cd54 on master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver-major: breaking change A non-backwards-compatible change; anything that breaks code - including adding a peerDep.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants