PDA

View Full Version : DatePicker DayNames problem



erickjs
Jul 05, 2016, 6:42 AM
Hello, In datepicker component week's days appear only the first letter of the word.
I have tried to write week's day in datepicker, but, it doesn't work. I want to see the whole word. For example,
for monday it would be "Monday" instead of "M". Is there any way to achieve it?
24662

fabricio.murta
Jul 05, 2016, 8:58 PM
Hello @erickjs! Welcome to Ext.NET forums!

The date picker component is designed to show only the first character of the weekday. Otherwise, it would just overflow the day column width.

If you want this behavior you would have to study the component and override other methods (like the one loading the week day names) as well as the CSS styling to make the columns wide enough to fit the whole week day names.

A first step you could do is override the function that returns the initials, in your override, but from this point on, you're on your own: we can't guarantee what it would break elsewhere.

As for a couple directions, the function that returns the weekday initials is Ext.picker.Date.getDayInitial(value). Also you may want to increase the width in the x-datepicker-column-header CSS class to fit the longer names. Well, and so on.

I hope this helps!

erickjs
Jul 07, 2016, 3:46 AM
I could solve the problem. Thanks! :)

fabricio.murta
Jul 07, 2016, 7:40 AM
Hello @erickjs!

Glad you could fix the issue! We'd really love it if you shared how exactly you fixed it. Might be very useful for other users looking for the same functionality.

Of course, if you don't mind sharing the trouble you had with the component!