Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    DateItem's value changing format after saveData

    SmartClient Version: v8.3_2012-11-20/LGPL Development Only (built 2012-11-20)
    Using FireFox 19.0.2

    I have a simple DateItem inside a DynamicForm. After modifying the date using the ui and saving my form's data ( saveData() )
    I seem to get a totally different format inside my executeUpdate's DSRequest data.

    Code:
    DateItem dateItem = new DateItem();
    dateItem.setValueField("date");
    dateItem.addChangedHandler(new ChangedHandler()
    	{
    		@Override
    		public void onChanged(ChangedEvent event)
    		{
    			((DateItem) event.getSource()).getValue(); // Using this getValue I get this format : Thu May 12 12:00:00 EDT 2011
    			saveData(); // Saving my DynamicForm's data
    		}
    	});
    saveData will call the executeUpdate method in my DataSource.
    If I inspect my "date" attribute in the executeUpdate's DSRequest data I have the following format : Thu May 12 2011 04:00:00 GMT-0400 (Eastern Daylight Time)

    Where does this format come from and is there a way to manage this ? I seem to have no control over this formatting, it all happens after a simple saveData.

    #2
    Anyone has an idea ?

    Comment


      #3
      getValue is probably returning a Date.toString version of the date which would be formatted in some default way to display to you.

      Can't you use DateItem's getValueAsDate if you want the original date object?

      Comment


        #4
        Hi sunnyl,

        the value that I get before the saveData really doesn't matter to me, what I'm interested in is the value format inside my DSRequest after the saveData.

        Thx for taking the time to reply!

        Comment


          #5
          Can you post a minimally working example that shows saveData()?

          Comment

          Working...
          X