1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

  2. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

Webservice json response to date

Discussão em 'PSDN - Forum' iniciado por Jorrit, Maio 25, 2016.

  1. Jorrit

    Jorrit Guest

    Hi,


    Im working on a serverside webservice call rest/json. In the response i get a date with format dd/MM/yyyy.

    example:

    "datum_eerste_afgifte_nederland":"31/12/2013","datum_eerste_toelating":"31/12/2013","datum_tenaamstelling":"31/12/2013"

    When i want to put the date in a variable and use rbv_api.setFieldValue or rbv_api.updateRecord i get the error "not a date".


    Here is a snippet of the code:

    var v_date1 = new Date();
    var v_tenaam = new Date();
    var v_afgnl = new Date();


    //loop trough result
    var i;
    for(i = 0; i < v_arr.length; i++) {

    v_date1 = v_arr.datum_eerste_toelating;
    v_date1 = rbv_api.formatDate(v_date1, "dd/MM/yyyy");
    }

    rbv_api.println(v_date1);

    rbv_api.setFieldValue("vehicle1", {!id}, "vehicle1d_firstadmission", v_date1);


    How to set te value v_date1 to a correct format to update a record?


    Regards Jorrit

    Continue reading...

Compartilhe esta Página