problem with retrieving values ​​date type

Good Morning,

I am developing a project with the “htmlxSuite 2012 Rel.1 (DHTMLX 3.5) Professional edition build 120731” version and have a problem with retrieving values ​​stored in PHP date type fields, a Sql Server 2008 DB.

I have the following js and css included (no error location):

In FormData, if I use the following statement to define the field ("$ FechaRecepcion" is the variable that receives the PHP): { type "calendar" dateFormat: "% d /% m /% Y" value: "'$ FechaRecepcion..'" name: "FechaRecepcion" label: "FechaRecepcion" serverDateFormat: "% Y /% m /% d", skin: "dhx_skyblue" enableTime: true, calendarPosition "right" }, It gives me the error ...: Uncaught TypeError: undefined is not a function 1 Uncaught TypeError: undefined is not a function dhtmlxcalendar.js: 829 1 _strToDatedhtmlxcalendar.js: 829 2 dhtmlXForm.items.calendar.setValuedhtmlxform_item_calendar.js: 65 3 doWithItemdhtmlxform.js 512 4 setItemValuedhtmlxform.js: 649 5 (anonymous function) estudios.php: 449 6.-1.7.1.js jQuery.extend.eachjquery: 653 7 (anonymous function) estudios.php: 448 8.-1.7.1.js firejquery: 1047 Self.fireWithjquery-1.7.1.js 9: 1165 10.-1.7.1.js donejquery: 7400 11. callback The format of "FechaRecepcion" in SQL Server is "07/17/2014 14: 10: 34.530" (type "datetime"). If I put the statement: {type: "input", label: "FechaRecepcion", name: "FechaRecepcion", value: "'.. $ FechaRecepcion'"} In the box ... Text "object Object" appears. I have no problem to record a date (works OK). The problem is only to recover the data saved. Thanks in advance for your help. Best Regards, Jaime Rodriguez

If you replace “07/17/2014 14: 10: 34.530” with something else does it work?

loading the form if I put for example:

$FechaRecepcion = “08/01/2014”;

or

$FechaRecepcion = “2014-01-08”;

also gives me error.

greetings,

Jaime

Forcing the value:
{
type “calendar”
dateFormat: “% d /% m /% Y”
value “07/17/2014”
name: “FechaRecepcion”
label: “FechaRecepcion”
serverDateFormat: “% Y /% m /% d”,
skin: “dhx_skyblue”
enableTime: true,
calendarPosition “right”
},

also gives me error the following values:

(…) Value “07/17/2014 14: 10: 34.530” (…)
(…) Value “07/17/2014” (…)

If I put this example:

{type: “calendar”, dateFormat: “% Y-% m-% d% H:% i”, name: “start_date”, label: “Start Date”, value: “2011-06-20 14:38” , enableTime: true, calendarPosition: “right”}

… Does not give me error but do not return the value (“2011-06-20 14:38”).

Try myForm.getCalendar(<CALENDAR_NAME>).getDate();

I’ll try it. many thanks !!
Jaime

Thanks for your help, in the end it has solved my partner, formatting the date type field to create the JSON:

// ** In PHP: ************************************
$ strCampos = implode (",", $ camposEstudioColaboradores);

$ sql = “SELECT $ strCampos
FROM Hg_EstudioColaboradores
WHERE idEstudioHg = '”. $ IdEstudioHg."’
AND idHogarHg = ‘"$ idHogarHg…"’ AND IdIndividuo = ‘"$ IdIndividuo…"’ ";
sqlsrv_query $ result = ($ con, $ sql);

if ($ result) {
$ array_final = array (‘result’ => 0, ‘data’ => $ sql);
miss json_encode ($ array_final);
exit;
}
if (! sqlsrv_has_rows ($ result)) {
$ array = array (“idEstudioHg” => $ idEstudioHg);
foreach ($ camposEstudioColaboradores as $ field) {
$ array [$ field] = “-”;
}
$ array_final = array (‘result’ => 1, ‘data’ => $ array);
miss json_encode ($ array_final);
else {}
$ r = sqlsrv_fetch_array ($ result, SQLSRV_FETCH_ASSOC);

/[b]/ formatting the date type fields: -----------------------------------------
$ fecha_aux = $ r [“FechaRecepcion”];

// the format in which it is stored in the sql server is “07/17/2014 14: 10: 34.530”
$ r [“FechaRecepcion”] = $ fecha_aux-> format (‘Y / m / d’);
------------------------------------------------ // ------------------------- [/b]
$ array_final = array (‘result’ => 1, ‘data’ => $ r);
miss json_encode ($ array_final);
}

// ** In javascript: ************************************

(…) {
type “calendar”
dateFormat: “% d /% m /% Y”
value: “’$ FechaRecepcion…’”
name: “FechaRecepcion”
label: “FechaRecepcion”
serverDateFormat: “% Y /% m /% d”,
skin: “dhx_skyblue”
enableTime: true,
calendarPosition “right”
}, (…)