Customize 'Today' label

6 posts, 0 answers
  1. Kumeri
    Kumeri avatar
    13 posts
    Member since:
    Jul 2018

    Posted 26 Aug 2020 Link to this post

    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. 

  2. Plamen
    Admin
    Plamen avatar
    3079 posts

    Posted 28 Aug 2020 Link to this post

    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).

  3. Kumeri
    Kumeri avatar
    13 posts
    Member since:
    Jul 2018

    Posted 14 Sep 2020 in reply to Plamen Link to this post

    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?? 

  4. Plamen
    Admin
    Plamen avatar
    3079 posts

    Posted 16 Sep 2020 Link to this post

    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/.

  5. Kumeri
    Kumeri avatar
    13 posts
    Member since:
    Jul 2018

    Posted 22 Sep 2020 in reply to Plamen Link to this post

    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. 

  6. Plamen
    Admin
    Plamen avatar
    3079 posts

    Posted 23 Sep 2020 Link to this post

    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).

Back to Top