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
Fix a few minor datetime bugs #757
Conversation
@@ -141,26 +141,24 @@ export default class TextInputWithDatePicker extends React.Component { | |||
const {value} = event.target | |||
const newDate = new DateTime(event.target.value, format) | |||
|
|||
if (value.length > 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.
Make sure you have 'hide whitespace changes' checked, otherwise the diff looks more complicated than it is 🙂
const parsedDate = | ||
// Fecha requires a format. If no format is specified, try ISO. | ||
fecha.parse(date, format || FORMAT_ISO8601) || | ||
// If format is specified but parsing fails, the value has probably been |
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.
// If format is specified but parsing fails, the value has probably been | |
// If format is specified but parsing fails, the value has probably been |
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.
Nope, sorry, prettier doesn't like that 😁
I put a few fixes together into a single PR, because they're tiny.
Bugs fixed:
Also, I fixed an unrelated potential bug in
TextInput
(in fortunately otherwise unused code):changed to