jQWidgets Forums

jQuery UI Widgets Forums General Discussions jqxCalendar doesn't return date object

Tagged: 

This topic contains 3 replies, has 3 voices, and was last updated by  admin 5 years, 6 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • jqxCalendar doesn't return date object #107207

    Alexey
    Participant

    Hi,
    when I’m trying to get calendar date from jqxCalendar (Javascript object, as mentioned in documentation) I’m getting Invalid date error.

    Here is a fiddle with the case I’m talking about http://jsfiddle.net/a1d45m0k/

    $("#jqxCalendar").jqxCalendar({
        theme: 'energyblue', width: 200, height: 200
    });
    var d = $('#jqxCalendar').jqxCalendar('val', 'date');
    
    $('#log').append(d);

    What am I doing wrong?

    jqxCalendar doesn't return date object #107218

    Peter Stoev
    Keymaster

    Hi Alexey,

    ‘date’ should be a Date object.

    $("#jqxCalendar").jqxCalendar({
        theme: 'energyblue', width: 200, height: 200
    });
    var d = $('#jqxCalendar').jqxCalendar('val', new Date(2010, 1, 1));
    
    $('#log').append(d);

    Regards,
    Peter

    jqxCalendar doesn't return date object #107220

    Alexey
    Participant

    Hi Peter,

    you didn’t understand my question. I don’t want to set a value, but get it.
    So this is from API reference

    // Get Date. The returned value is Javascript Date.
    $('#jqxCalendar').jqxCalendar('val', 'date');

    Probably there are some other convenient method to get a javascript object from the jqxCalendar, aren’t there?

    jqxCalendar doesn't return date object #107221

    admin
    Keymaster

    Hi Alexey,

    Then don’t pass a parameter when you call the method.

    $("#jqxCalendar").jqxCalendar({
        theme: 'energyblue', width: 200, height: 200
    });
    var d = $('#jqxCalendar').jqxCalendar('val');
    
    $('#log').append(d);

    Regards,
    Peter

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

You must be logged in to reply to this topic.