Unplanned
Last Updated: 03 Nov 2020 15:09 by ADMIN
Philip
Created on: 03 Nov 2020 15:05
Category: DateInput
Type: Feature Request
3
Paste date with the same format

My users want to paste dates in the date inputs (date pickers in our case). This seems to work in Kendo, but does not work in Blazor, even when the format of the copied data matches the Format of the component.

 

<p>
    Try copying this date which is valid in the current format: 23/03/1998
    <br />
    then paste it in the date picker and see what happens to the <code>TheDate</code> field
</p>

@TheDate
<br />

<TelerikDateInput @bind-Value="TheDate" Format="dd/MM/yyyy" /> @TheDate.ToString("dd/MM/yyyy")

@code {
    DateTime TheDate { get; set; } = new DateTime(2019, 11, 27, 02, 03, 44);
}

---

ADMIN EDIT

Allowing the paste into the DateInput (and by extension date picker,...)  would have a lot of cases to control and that is why we have not yet enabled it. If the format is M/d/yyyy, for example, validation for numbers lower or equal to 12 would not be possible when the month is regarded. If the user pastes 8/2/2020 could mean two things - 8th of February 2020 or 2nd of August 2020. This might cause issues as the data that goes to the database might be incorrect and causing the application to misbehave.

That being said, how would you suggest handling the pasting of dates in the component. How would you like from us to handle the format difference of the dates? Please comment below.

---

0 comments