andyaduff

using dijit.form.DateTextBox and dijit.form.TimeTextBox with geodatabase

Discussion created by andyaduff on May 23, 2012
Latest reply on May 28, 2012 by wanderingwarden
Im working on a javascript web page to allow spatial data to be directly entered to a geodatabase.  Does anybody have some sample code for formmating dates and times for entry into the geodatabase from dijit.form.DateTextBox and dijit.form.TimeTextBox?

Im able to successfully get the values from the controls using

var od = dojo.byId("dateval").value;
var ot = dojo.byId("timeval").value;

which result in

od = "5/8/2012"

and

ot = "11:30 AM"

which I thought would be easy to assign to attributes of a graphic and submit but I am having trouble and my code is failing when I submit those attributes to featureLayer.applyEdits.  Do I need some special formatting before assigning these values to a esri.Graphic so that they can go into a geodatabase date field properly (im on SDE 10 and SQL server 2008).  Sure I could store these values in text fields but that kind of defeats the point of geodatabase dates.

Thanks for your help,

Andy

Outcomes