DateInput

2 Answers 60 Views
DateInput
Vladislav
Top achievements
Rank 2
Iron
Iron
Vladislav asked on 27 Oct 2023, 02:13 PM

Hello.

I have a special question. Our users use date control, so they delete the current date / text in the input and enter the whole date with dots manually. But we can't do it like this in react data input. Is it possible for the input to be empty? There was such an option in JQuery, I could enter anything there.

 

For example here: https://demos.telerik.com/kendo-ui/dateinput/api

 

 

Well thank you

2 Answers, 1 is accepted

Sort by
0
Accepted
Vladislav
Top achievements
Rank 2
Iron
Iron
answered on 03 Nov 2023, 02:48 PM
Hello.

It is a pity. We need a custom component where the user can write without restrictions / separators. The problem with this approach, which is described as not working for example copy paste :(. OK. So let's create our own.

Thank you for your response.
Vessy
Telerik team
commented on 07 Nov 2023, 01:08 PM

Hi, Vladislav,

I cannot help but agree with you that this functionality would be helpful, therefore I encourage you to submit a feature request in our Feedback portal about it so we can track the overall interest in such improvement:

1
Vessy
Telerik team
answered on 31 Oct 2023, 01:32 PM

Hello, Vladislav,

The component used in the configurator of the linked demo is a DatePicker and you can configure its placeholder property to display custom text (or empty string) while the input is not in focus:

You can also refer to the available options at the end of the above article explaining how to chnage te `formatPlaceholder` of the component:

Please note that the DatePicker is designed in such way that it will always separate the day, month and the year values and free typing is not possible. For removing the values from the formatPlaceholder, the only option that we can suggest is to use the custom format, but note that it will still keep the separators, so the user will need to select them before pasting the desired date:

        <DatePicker
          format="MM/dd/yyyy"
          formatPlaceholder={{
            year: ' ',
            month: ' ',
            day: ' ',
          }}
        />

You can see a sample demonstrating this approach here:

Also, note that the custom values are not empty strings, but an empty space, because if it is an empty string, the default value will be used instead.

For a different result, you might have to define custom input and handle the parsing of the input manually:

I hope the provided information will be helpful for you.

Regards,
Vessy
Progress Telerik

Stay tuned by visiting our public roadmap and feedback portal pages! Or perhaps, if you are new to our Kendo family, check out our getting started resources!

Tags
DateInput
Asked by
Vladislav
Top achievements
Rank 2
Iron
Iron
Answers by
Vladislav
Top achievements
Rank 2
Iron
Iron
Vessy
Telerik team
Share this question
or