Edit Widget Date Field Problem

1782
0
02-23-2011 09:52 AM
TimHoward
New Contributor II
Ok so if your using the Edit Widget on a "Date" field by default there will be a calendar that pops up for you to select a date for that field.  That is fine.  The little problem I'm having is the date always has a generic time attached to it, usually 5:00AM.  You don't see the time, nor can you select or edit it in the Edit Widget.  However when you open the data in ArcMap or use the identify tools you will clearly see the date + 5:00AM.  Any ideas how to change this behavior?  I've tried formatting the date field in ArcMap.  I've also tried changing some things in the EditWidget.mxml here:

          private function featureLayer_selectionComplete(event:FeatureLayerEvent):void
{
   for each (var field:Field in event.target.layerDetails.fields)
    {
       if (field.type == Field.TYPE_DATE)
         {
  for each (var feature:Graphic in event.features)
    {
        //var date:Date = new Date(feature.attributes[field.name]);
   var date:Date = new Date();
   if (date.milliseconds == 999)
   {
                    date.milliseconds++; //Add 1ms to date values ending in 999 to workaround REST 
//date bug
   }
               feature.attributes[field.name] = date.time;
   }
        }
  }
         }

I need the user to be able to change the time to whatever they want.  Any reply is appreciated.  Thanks.

Tim
Tags (2)
0 Kudos
0 Replies