-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
[@mantine/dates] TimeInput: Add format
and clearable
prop
#607
Conversation
format
and clearable
prop
src/mantine-dates/src/components/TimeInput/demos/configurator.tsx
Outdated
Show resolved
Hide resolved
src/mantine-dates/src/components/TimeInput/demos/configurator.tsx
Outdated
Show resolved
Hide resolved
2022-01-03.17.56.58.mov |
Should I add a prop to allow empty fields or this will be a breaking change because we won't have the
This is a problem with the current approach how we save the state because its currently a Date object and if we want your described function then we need to save them individual. |
No, that's fine, it's not actually breaking
Well, I guess it's the only option then |
@rtivital could you please look at this again, Thanks |
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.
It works fine, great job! There are several issues left to fix, and it can be merged.
src/mantine-dates/src/components/TimeInputBase/AmPmInput/AmPmInput.tsx
Outdated
Show resolved
Hide resolved
src/mantine-dates/src/components/TimeInputBase/TimeInputBase.styles.ts
Outdated
Show resolved
Hide resolved
src/mantine-dates/src/components/TimeInputBase/TimeInputBase.styles.ts
Outdated
Show resolved
Hide resolved
src/mantine-hooks/src/use-validated-state/use-validated-state.test.ts
Outdated
Show resolved
Hide resolved
All good, thanks! |
Hey everyone, @rtivital @jerebtw ! On french keyboards for instance, typing "am" does not change the AmPm input value, but typing Let me know if you can do something about it 🙏 |
@brunovegreville do people in France use am/pm time format? |
Thanks for pointing this out i will look in to it |
Fix for #581 and #580
This also can add a new hook (if wanted) called
use-valid-state
. (It's similar to useState but accepts avalidation
function and returns the last valid value, a set value function and the current value)