This is a migrated thread and some comments may be shown as answers.

Customize 'Today' label

5 Answers 317 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Kumeri
Top achievements
Rank 1
Iron
Veteran
Kumeri asked on 26 Aug 2020, 02:06 PM

In my project i have a requiremenr to customize the today button label in the scheduler. And the new lable can have more than one value, based on our requirement. As far i have investigated i couldn't find a proper solution for this. 

currenlty to customize view names(ex: week, month, timeline,) i am changing them in the configuartion like below,

views = { title: ''MyMonthLable', name: 'month',  type: 'month'}

i would like to know whether it possible to do the same for the Today button lable in each view in the configuration, (or any available template to do so)

If this is not possible i would like to which method in your source code returns the lable for Today button, so that i can overrride in each view class and cutomize it to return the new lable. (currenlty i am using this similar pattern and overrride dateForTitle(), and some other methods)

Thank you. 

5 Answers, 1 is accepted

Sort by
0
Plamen
Telerik team
answered on 28 Aug 2020, 11:32 AM

Hi,

Thank you for getting in touch with us.

Currently there is not separate option for this today message template yet once possible solution is to use the dateForTitle method that yo already use and set the desired today message from there as for example in the code below:

        dateForTitle: function() {
            this.options.messages.today="some1"
            return kendo.format(this.options.selectedDateFormat, this._firstDayOfMonth, this._lastDayOfMonth);
        },

Hope this will help you solve the issue. If you have further questions please let me know.

Regards,
Plamen
Progress Telerik

Five days of Blazor, Angular, React, and Xamarin experts live-coding on twitch.tv/CodeItLive , special prizes and more, for FREE?! Register now for DevReach 2.0(20).

0
Kumeri
Top achievements
Rank 1
Iron
Veteran
answered on 14 Sep 2020, 02:34 PM

Hi, 

i tried this solution. But unfortunately it does not work. Nothing changes, even no errors. :( Is there any other way to try make this work?? 

0
Plamen
Telerik team
answered on 16 Sep 2020, 10:53 AM

Hi,

Thank you for getting back and please excuse me for not providing the right answer - it seems like I pasted the wrong snippet. 

Here is the  correct snippet of the scenario:

  dateForTitle: function() {
            $(".k-nav-today .k-button-text").text(this.options.messages.today)
 
            return kendo.format(this.options.selectedDateFormat, this._firstDayOfMonth, this._lastDayOfMonth);
        },

Here is the working dojo of the scenario - https://dojo.telerik.com/@zdravkov/asAjUGuZ/2

I you have further questions please let me know

Regards,
Plamen
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/.

0
Kumeri
Top achievements
Rank 1
Iron
Veteran
answered on 22 Sep 2020, 06:08 AM

Hi, Thank you for the quick response. This solution works. :) But this creates some styling issues in my project. i think that is because we edit the text in the HTML element after it is rendered. Sp it created some styling issues when the text is too long and too short compared to "Today" word. 

As you have mentioned currenlty there is no separate template to edit this Today button label from your side. Will you be able to add a standar way (probablt through a template), where we can customize this and adda a label property to the Today Button. Will you be able to provide such solution in next release. :) I really appreciate if you can do so. 

0
Plamen
Telerik team
answered on 23 Sep 2020, 02:05 PM

Hello,

I have added an issue and we will research it for a possible improvement - https://github.com/telerik/kendo-ui-core/issues/6036.

Please excuse us for this inconvenience caused by the issue.

Regards,
Plamen
Progress Telerik

Five days of Blazor, Angular, React, and Xamarin experts live-coding on twitch.tv/CodeItLive, special prizes, and more, for FREE?! Register now for DevReach 2.0(20).

Tags
Scheduler
Asked by
Kumeri
Top achievements
Rank 1
Iron
Veteran
Answers by
Plamen
Telerik team
Kumeri
Top achievements
Rank 1
Iron
Veteran
Share this question
or