-
-
Notifications
You must be signed in to change notification settings - Fork 245
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
Support date and datetime-local inputs #480
Conversation
Codecov Report
@@ Coverage Diff @@
## master #480 +/- ##
=====================================
Coverage 100% 100%
=====================================
Files 157 157
Lines 1401 1402 +1
=====================================
+ Hits 1401 1402 +1
Continue to review full report at Codecov.
|
Hi @Floriferous. The code itself is good. I'm just not sure if this is the right way. Right now, each theme consequently implements some date picker - such change tends to implement more and more full-blown ones for each theme. It's more of an opinion thing, just let me think about it. Also, what about |
You're right, I agree it doesn't feel like the right way to do this. Ideally, I should be able to simply specify what html |
OK, so let's implement this in each package (not in AntD as there's a custom picker). |
Ping @Floriferous. |
How do you suggest we do this:
The schemas will probably have to be defined as follows: new SimpleSchema({
dateField: { type: String, uniforms: { type: 'date' } },
dateTimeField: { type: String, uniforms: { type: 'time' } },
}); Or should we store them as |
As a rule, custom component is the best here - it can handle the in (model ~> DOM) and out (DOM ~> model) logic, parametrized with props (defined in the schema or directly in props). Now, we'd like to enhance the current flaky implementation a bit to support also We have to chose now, if we want to support more than one as well or not. IMO There's even a special paragraph on that, on Material-UI docs:
All in all, I'd rather not do it and always suggest to use an existing picker or create a custom field for that. |
Oh, so should we just close this PR then? |
I thought about it once again and yes, I'm closing. |
It'd be helpful for DateField to also support
type: 'date'
inputs, instead of onlydatefield-local
. Currently, you can change the type, but the data does not appear, as it has to be formatted properly:YYYY-MM-DD
.I propose a working, though not very elegant solution, that checks for
inputProps
being passed to the material-uiInput
component. (source)So to use this you have to do (with simple schema):
It works in chrome, haven't tested it in other browsers yet.