-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Improve Date/DateTime type parameters #2695
Improve Date/DateTime type parameters #2695
Conversation
Since this Pull Request originated from a forked repository, Now cannot deploy it as there are potential security risks. If you are a collaborator on this repository, consider making this Pull Request from a branch on the same repository instead of a fork. |
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.
Looks good and much less code than I expected this to be 😅
See some comments.
Also try to "stress" test it with a few edge case. I remember the browser default input field had issues where it would show a value but actually have a null value.
client/app/services/query.js
Outdated
// (react does not support two-way binding with `ngModel`) | ||
this.updateValue = (function updateValue(value) { | ||
this.ngModel = value; | ||
}).bind(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.
Why not use the following?
this.updateValue = value => this.ngModel = value;
(=>
instead of .bind(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.
oh, missed it, you're right
client/app/components/DateInput.jsx
Outdated
|
||
DateInput.defaultProps = { | ||
value: Date.now(), | ||
placeholder: 'Select date', |
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.
Select Date
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.
Also seems that we don't really use it customer placeholders. Maybe just pass a static value?
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.
One more question: how does it look side by side with regular input fields?
I tried to use it from users perspective - and it works as it should: it displays value if there is value set, and it shows placeholder when param does not have value set. |
There are 3 options here:
@kocsmy what are your thoughts? |
Hmm, it should be fairly simple to change their design to look like ours but if we plan to use more of Ant components or even use their whole library, then that's a bigger plan :) |
Merged 🤩 |
We will use more and more of their components to the point where we can say that we use the whole lib :) I merged this already so give this a look and see what's the simplest thing we can do to make it look less alien, before we commit to a bigger plan. |
Sure, I'll take a look and see if we can improve this quickly. |
Issue #2642
Default date/time inputs replaced with Ant Date/Time picker.
Screenshots:
Date:
Date/Time:
Date/Time with seconds (same as Date/Time but different format):