简体   繁体   中英

how to get current day of Kendo calendar

Is there any way get selected day of calendar? to get alert when i navigate from monday to tuesday as "Tuesday".

I know this example is similar to my question.

jsfiddle.net/OnaBai/jf2XK/

$("#cal").kendoCalendar({
    navigate: function () {
        var cur = this._current;
        var prev = this._previous;
        if (prev && cur && prev.getFullYear() !== cur.getFullYear()) {
            alert("year change");
        }
        this._previous = this._current;
    }
})

But I'm new to jquery and mvc,. Please help.

Update:I need to get the day as I need to fix numbers 1 to 7 for each day of the calendar.

http://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_getday

Why not use the 'change' event to get the new value every time it changes?

http://jsfiddle.net/jf2XK/4/

$("#cal").kendoCalendar({
    change: function(e){
        alert(this.value()); // your value is here
    }
})

Or else just use the 'value()' method --> http://docs.kendoui.com/api/web/calendar#methods-value

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM