Skip to content
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

DateInputField value control #125

Open
mkatanec-croz opened this issue Sep 7, 2023 · 2 comments
Open

DateInputField value control #125

mkatanec-croz opened this issue Sep 7, 2023 · 2 comments
Labels
enhancement New feature or request question Further information is requested

Comments

@mkatanec-croz
Copy link
Contributor

Basic information

  • Tiller version:
    1.7.0
  • Module:
    formik-elements

Enhancement description

Enable greater control over value type of DateInputField by providing prop that will define value type

Current behaviour

Value type is determent by checking instanceof value

Wanted behaviour

Value type will be determent by optional prop format which will be used as format for parsing date to string using datefns. Only if that prop is provided component would set value as string

@mkatanec-croz mkatanec-croz added the enhancement New feature or request label Sep 7, 2023
@jtomic-croz
Copy link
Collaborator

@mkatanec-croz you want a prop something like this: mode: 'string' | 'date' so you can force only one value type in form?
And an additional format for the value parsing? Do you need this format be different from display format?

@mkatanec
Copy link

I was thinking in direction of using only format to determinate if the value should be Date or string but your question for display type made me think again about it. I think it would be best to have both format and displayFormat props. format determinates type of value to be stored (Date if prop is not provided and string if prop is provided), displayFormat just defines the format for displaying the value

@fbeceic fbeceic added the question Further information is requested label Jun 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants