uniforms
uniforms copied to clipboard
Unified implementation of DateField type handling.
Fixes #1138
Unified the implementation of date type logic across DateFields in themes. The only theme that was not adjusted was antd due to the fact that this is handled by a separate prop which is showTime that is already implemented. antd does not accept a type prop like the native date input does.
to do:
- [x] Copy the date test to all other themes
- [x] Test manually once more
Screenshots
tested for this playground schema
new SimpleSchema2Bridge(
new SimpleSchema({
date: {
type: Date,
defaultValue: new Date(),
uniforms: {
type: 'date',
},
},
date2: {
type: Date,
defaultValue: new Date(),
},
})
)
unstyled

semantic

mui

material

bootstrap5

bootstrap4

bootstrap3

Codecov Report
Merging #1140 (776d64b) into master (337a02c) will increase coverage by
0.00%. The diff coverage is100.00%.
@@ Coverage Diff @@
## master #1140 +/- ##
=======================================
Coverage 98.48% 98.48%
=======================================
Files 228 228
Lines 3637 3639 +2
Branches 947 953 +6
=======================================
+ Hits 3582 3584 +2
Misses 4 4
Partials 51 51
| Impacted Files | Coverage Δ | |
|---|---|---|
| packages/uniforms-bootstrap3/src/DateField.tsx | 100.00% <100.00%> (ø) |
|
| packages/uniforms-bootstrap4/src/DateField.tsx | 100.00% <100.00%> (ø) |
|
| packages/uniforms-bootstrap5/src/DateField.tsx | 100.00% <100.00%> (ø) |
|
| packages/uniforms-material/src/DateField.tsx | 90.90% <100.00%> (-1.10%) |
:arrow_down: |
| packages/uniforms-mui/src/DateField.tsx | 100.00% <100.00%> (ø) |
|
| packages/uniforms-semantic/src/DateField.tsx | 100.00% <100.00%> (ø) |
|
| packages/uniforms-unstyled/src/DateField.tsx | 100.00% <100.00%> (ø) |
|
| ...kages/uniforms-bridge-graphql/src/GraphQLBridge.ts | 100.00% <0.00%> (ø) |
|
| ...niforms-bridge-json-schema/src/JSONSchemaBridge.ts | 100.00% <0.00%> (ø) |
Help us with your feedback. Take ten seconds to tell us how you rate us.
Not sure if this is a regression of this PR, but the clear button is not working (does nothing) when selecting the date with the picker instead of entering by the keyboard.
Other than that, the types date and datetime-local work correctly.

@kestarumper, @wadamek65 Can you check this "clear" button? If it didn't work before, then I guess it's fine.
To do:
- Clearing the date input for native browser picker is not a regression. It may be worth creating a new issue to address this in the future or see exactly where it stems from.
- Check if this PR resolves: #1162