jQuery UI Widgets Forums Scheduler today highlight

This topic contains 7 replies, has 5 voices, and was last updated by  thesled 4 years, 11 months ago.

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
  • today highlight #88240

    geckus
    Participant

    so sorry if im a noob to this scheduler, most that i have explored, usually have this built in.
    Anyone can help with highlighting the current date of the calender in scheduler

    today highlight #88259

    Christopher
    Participant

    Hi geckus,

    Unfortunately, it’s not possible to hightlight the current day in the jqxScheduler. You have the “Day” view that shows only one day. You can make it to show the current day if you set the date property to the current day. For example, date: new $.jqx.date(2016, 10, 17).

    Best Regards,
    Christopher

    jQWidgets Team
    http://www.jqwidgets.com

    today highlight #88313

    geckus
    Participant

    thanks for the reply. anyone know a quick workaround for it to highlight. like a workaround for css?

    today highlight #88502

    Peter Stoev
    Keymaster

    Hi geckus,

    Unfortunately, there is no workaround we can suggest about this missing feature in our Scheduler component.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    today highlight #101473

    Karthikeyan
    Participant

    Hi,

    We just got the jqwidgets-ver6.0.5.

    Is hightlighting the current day in Monthview & Weekview available in the jqxScheduler now?

    today highlight #101510

    Karthikeyan
    Participant

    Hi,

    I found a method to get current date highlighted.
    Below are the lines which i used to do it.

    $(“#jqxScheduler”).jqxScheduler({
    rendered: function () {
    var currentdateval = moment().format(‘YYYY-MM-DD 00:00:00’);
    $(‘[data-date=”‘ + currentdateval + ‘”]’).css(‘background’, ‘#f8efc8’);
    }
    });

    today highlight #107087

    thesled
    Participant

    Thanks for the workaround Karthikeyan. Improving on your solution a bit…

    1. I would put the code in the “ready” callback rather than “rendered”, since rendered gets called multiple times (ready only gets called once)
    2. I suggest using the built-in jqx.date rather than adding the unnecessary “moment” library
    3. And just for good measure, use try/catch (as you always should)

    So something like:

    ready: function () {
    	try {
    		$('[data-date="' + new $.jqx.date().toString("yyyy-MM-dd 00:00:00") + '"]').css("background", "#f8efc8");
    	} catch (errMsg) { YourErrorHandler(errMsg); }
    }
    today highlight #107089

    thesled
    Participant

    Correction… adding the above code to “ready” function will cause the highlighted cell to reset (back to blank) when the view is updated (by opening edit dialog, etc.). So add the above code to the “rendered” function as Karthikeyan suggested.

Viewing 8 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic.