Duplicated
Last Updated: 02 Jun 2022 12:13 by web
web
Created on: 19 May 2022 06:52
Category: UI for Blazor
Type: Feature Request
4
Make you date inputs (Datepickers e.t.c.) work with text input like all your javascipt controls

All I ask is to give a way to have a proper working datepicker. Like your javascript datepickers. That doen't care only for right values but for the person that uses it. Telerik was an early adopter in the Blazor ecosystem, I don't know how they haven't yet fixed their datepickers.

You can do this with many ways. I don't know them all but I will propose some here.

  1. Create a second datepicker component that works properly.
  2. Put an attribute in the component to work with free-text
  3. Maybe if this attribute is on you can switch behind between 2 different components
  4. Find a other solution of your own.

In the end behind the scenes you shouldn't bind the datepicker input in the datetime property but to a sting one. DevExtress has done this right.

This will solve

  1. Proper user expirience when a user uses the keyboard to edit dates
  2. Copy-Paste issue
  3. Clear date parts issue
  4. all from 30/4/2022 to edit to 31/5/2022 with out having to clear the input
  5. Strange editing of years (I have an example in the end)
  6. Allow to have dots or what ever the users want between dates numbers. (e.x. 13.3.2022 )

I this is a trade-off and you will have senarios with wrong inputs and other things, but you already know them from the javascript world, and it's less importand than the aboves.

 

 

*Strange editing of years

Lets say that we have the year 1998 19and we want to put 2014.

the users See
-> 1/1/1998
-> 1/1/9982
-> 1/1/9820
-> 1/1/8201
-> 1/1/2014

That's not user friendly, and is very disturbing.

Duplicated
This item is a duplicate of an already existing item. You can find the original item here:
10 comments
web
Posted on: 02 Jun 2022 12:13

Thank you.

It's nice that i see you are considering this request as an issue.

ADMIN
Svetoslav Dimitrov
Posted on: 25 May 2022 13:18

Hello Chrysostomos,

After extensive discussions on the topic, we have opened 2 new feature requests - A way to customize the mask of the date pickers (or remove it altogether) and a way to select which event will trigger the validation. I have added your Vote for both those features and I would encourage you to click the Follow button to receive email notifications on status updates.

These improvements will be a high priority for our R1 2023 release. To denote that change, and our intentions to work on improving the date pickers. I have marked this feature request as "Duplicate" to the one for the mask. 

Regards,
Svetoslav Dimitrov
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

web
Posted on: 20 May 2022 08:10

Sorry, but you can convice me you are right in the direction you took.

It can't be everyone is wrong allowing users to edit free text dates and you are right. 

They did it for better user experience.

 

 

p.s. I hope you always make reseach, but in the case of datepickers I don't belive it unless you show someting. 

ADMIN
Svetoslav Dimitrov
Posted on: 20 May 2022 07:40

Hello web,

The short answer is yes, we always make research when implementing a new component or a feature, to further expand:

We decided to implement a component that to the full extent uses the strengths of Blazor and the advantages that come from being a .NET-based framework. That is why we decided to use a DateTime behind the scenes and not a string.

In computer science, there is always more than one way to achieve something. By taking a decision there is always a trade-off. In your previous posts, you have made a comparison between our approach and the approaches of other DatePickers. Each approach has its use-cases, advantages, and disadvantages. 

Telerik component

We took a more protective approach when implementing the DatePicker to ensure the purity of the dates it returns. If we decided to go for a more frivolous approach and allow free text a lot of questions would have been raised:

  • What date must the component return if the user types plain text?
  • What happens if the date segment is invalid?
  • What happens if the month segment is invalid?
  • What happens if the separator is an "x" (30x04x2022)?
  • Must the component try and parse dates written in words (eleventh of may two thousand and twenty-two)? If yes, what happens if it is written in other languages, or if there is a typo? Or if the year is written as twenty twenty-two? Or the client wants to take the American date format May of eleventh twenty twenty-two?
    • There is a plateful of scenarios here that must be considered and their answers are not trivial.

     

Based on the questions above, we decided to stick with the approach we have taken and improve it over time.

If you are using the Telerik UI for Blazor DatePicker you can rely on a component that will return a valid date without any further work for the backend.

Other DatePickers

The other date pickers took a more frivolous approach to allow plain text and invalid dates and trying to parse them to a valid date. I would refrain from an opinion if that is more or less intuitive.

The same question can be extended to a computer science level - is C# of JavaScript better? Not an easy question to answer for sure as both languages have their strengths over the other and it is up to personal preferences to use one or the other.

On the UX part of your question, as part of the R1 2023, the component will be reviewed by the UX design team, and some improvements will be added to the component. There will be a list of UX improvements including editing of years. However, changes in the data binding mechanism are not exactly UX changes

Regards,
Svetoslav Dimitrov
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

web
Posted on: 19 May 2022 16:07

Sorry, I ask to be edited as text. Like your javascript ones and like all the other libraries.

Not to solve some of the current issues in your current solution.

So, you didn't answer 2 importan things.

1. Have you made any research about it, before taking the big decision to make it work as it is? Can you provide info?

2. Can the UX of this control (when wourking with keyboad) be reviewer from some UX Expert in telerik outside of Telerik Blazor Team? To tell us if this control works ok.

ADMIN
Svetoslav Dimitrov
Posted on: 19 May 2022 14:51

Hello,

I have discussed this matter with the Product Manager of Telerik UI for Blazor as part of our R1 2023 and we plan to provide improvements to the date pickers to improve their functionality, the paste dates feature request will be a high priority for those improvements. Another improvement will be the revision of how years are edited by using the keyboard as I can agree it is not really intuitive. 

Regards,
Svetoslav Dimitrov
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

web
Posted on: 19 May 2022 14:13
Can I ask for a review in this issue from senior member outside of Telerik Blazor Team? Someone who has UX experience?
web
Posted on: 19 May 2022 14:11

My request was to make your datepicker work like your javascript datepickers and allow free text.


This are problems of your current solution

  • The ability to copy and paste dates
  • Clear date segments
  • Free-text input
  • Allow different separators like dots
  • Bind the DatePicker to string behind the scenes

 

Please don't change what i asked.

web
Posted on: 19 May 2022 13:35

The big issue it that your datepicker works very bad when the user uses the keyboard and try to change the value more than one time.

Have you made any research about it, before taking the big decision to make it work as it is?
Can you show on the web any other library that works that way? To consider it right?

Let't see.

Datepicker Telerik JS -> https://demos.telerik.com/kendo-ui/datepicker/index

PrimeNG -> https://www.primefaces.org/primeng/calendar

Datepicker Devexpress Blazor-> https://demos.devexpress.com/blazor/DateEdit

Datepicker Syncfusion Blazor -> https://blazor.syncfusion.com/demos/datepicker/default-functionalities

Datepicker grapecity -> https://www.grapecity.com/wijmo/demos/Input/InputDate/Overview/purejs

Datepicker material.angular https://material.angular.io/components/datepicker/overview

Datepicker infragistics -> https://www.infragistics.com/products/ignite-ui-angular/angular/components/date-picker
Datepicker infragistics Blazor -> https://www.infragistics.com/products/ignite-ui-blazor/blazor/components/editors/date-picker

ng-bootstrap  --> https://ng-bootstrap.github.io/#/components/datepicker/examples

 

I can find many more. All of the are wrong and the Blazor Telerik Components team is right?

ADMIN
Svetoslav Dimitrov
Posted on: 19 May 2022 11:51

Hello,

First of all, I would like to sum up the requests you have made:

  • The ability to copy and paste dates
  • Clear date segments
  • Free-text input
  • Allow different separators like dots
  • Bind the DatePicker to string behind the scenes

The ability to copy and paste dates

We have an open feature request for pasting dates with the same format in the date pickers for Telerik UI for Blazor. Once this feature is implemented the users will be able to paste dates in the same format.

Clear date segments

Clearing a specific segment of the date is available when the component is bound to a non-nullable DateTime object. When binding the DatePicker to DateTime? and clearing a date segment, the object becomes null, thus the whole input is deleted. This is the expected behavior when working with nullable objects.

Free-text input and binding the DatePicker to a string behind the scenes

In order to achieve free-text input, the component's data binding mechanism must be changed. Currently, the data binding works on every keystroke in the input (ValueChanged), but the free-text input will require changing that event to OnChange. The reason behind that is that if the user types a temporary invalid date the argument in the ValueChanged event handler will be invalid. 

In the ValueChanged event handler:

  1. The starting date is 30/04/2022. 
  2. The user types 3, the argument in the handler will be 3/04/2022
  3. The user types 1, the argument in the handler will be 31/04/2022. This is an invalid date and if other features across the application rely on that date they will fail.

Free-text input will bring a major heuristic task - if the user types an invalid month to what date shall we default - the last valid date or the DateTime.Today as DevExpress did?

Binding the DatePicker to a string behind the scenes will take away the nativeness of the component. The Blazor framework gives us the ability to use the corresponding strongly-typed data types. If we decide to bind the DatePicker to a string, the same can be applied to a Numeric textbox. Taking a loosely-type approach for our components is something that takes away the benefits from Blazor (that it uses C# and not JavaScript).

Allow different separators like dots

This behavior is available through globalization. Based on the culture of the application the DatePicker takes the specific separator. The Globalization demo for the DatePicker showcases that concept:

  1. Select the "Bulgarian" option from the "SELECT YOUR LANGUAGE" DropDownList
  2. The DatePicker will render a date with the format day.month.year
  3. You can use the dot separator to switch the focus between the date segments

What you requested is switching the data binding mechanism from ValueChanged to OnChange. This will be a major breaking change and the current behavior of the DatePicker will no longer be available. Developing a second DatePicker that essentially duplicates the behavior of our JavaScript components will go as close to wrapping a JavaScript component as possible.

As part of our R1 2023, we plan to provide improvements to the date pickers to improve their functionality, the paste dates feature request will be a high priority for those improvements. Another improvement will be the revision of how years are edited by using the keyboard as I can agree it is not really intuitive. 

Having said that, I will "Decline" this feature request as changing the data binding mechanism (or developing /wrapping/ a JavaScript-like component) are not options we are willing to take.

Regards,
Svetoslav Dimitrov
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.