jQWidgets Forums

jQuery UI Widgets Forums Editors DateTimeInput Set Date ?

This topic contains 3 replies, has 2 voices, and was last updated by  Peter Stoev 11 years ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Set Date ? Posts
  • Set Date ? #49793

    mallepaddi
    Participant

    Hi

    $(‘#journeyDate’).val(new Date(2014, 02, 20));

    setting as “20/3/2014” ,any thing to edit ?

    Thanks

    Set Date ? #49801

    Peter Stoev
    Keymaster

    Hi mallepaddi,

    The JavaScript Date object’s constructor requires setting the Year, Month and Day. The Display Format in jqxDateTimeInput depends on its formatString. You may check the available demos. There’s a demo in the demos section which shows how to configure the formatString.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Set Date ? #49823

    mallepaddi
    Participant

    HI

    It was like

    $(‘#journeyDate’).val(new Date(2014, 02, 20));

    $(“#journeyDate”).jqxDateTimeInput( {closeCalendarAfterSelection : true,width:’125px’,height:’20px’,theme : theme,formatString:’d/M/yyyy’});

    Still setting it as “20/3/2014”

    Anything worng in above code ?

    Thanks

    Set Date ? #49827

    Peter Stoev
    Keymaster

    Hi mallepaddi,

    3 is the correct month. The JavaScript Date Object’s Months start from 0 i.e January is 0, February is 1. You can learn about JavaScript’s Date object on this page: http://www.w3schools.com/js/js_obj_date.asp

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

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

You must be logged in to reply to this topic.