Closed GoogleCodeExporter closed 8 years ago
I notice another case. Maybe it helps in fix
Map valuesAsMap = form.getValues();
//valuesAsMap have 2011-09-20
JavaScriptObject jso = JSOHelper.convertMapToJavascriptObject(valuesAsMap);
//jso have date one day earlier 2011-09-19
String jsv = JSON.encode(jso);
//jsv has date 2011-09-19
Original comment by mateusz....@javart.eu
on 17 Sep 2011 at 1:54
If you just toString() a datetime value or likewise look at it under a
debugger, it will be formatted according to your browser or IDE timezone, or
may show internal information if it's intended as a "date" value with no
meaningful time component.
To validly report a bug, you must specifically use the formatter functions
provided by SmartGWT and/or demonstrate that a SmartGWT component displays the
wrong value (but no such bug exists so far as we know).
If you submit a new, correct test case we'll mark the bug valid again.
Original comment by smartgwt...@gmail.com
on 19 Sep 2011 at 4:23
so if I use dynamicForm.getValuesAsCriteria() I can't be sure of the correct
date?
I have a grid and the form where I specify criteria on which I want fetchData
in the listgrid.
Original comment by mateusz....@javart.eu
on 19 Sep 2011 at 5:12
Again, the problem is specifically how you're looking at the values, which you
haven't shown. Show a test case that indicates that SmartGWT is getting the
value wrong in it's own format or display, and that would be a valid bug report.
Original comment by smartgwt...@gmail.com
on 19 Sep 2011 at 5:26
OK, attached file (Entry point) with a sample where using only smart-gwt code
and reproducing problem with date minus one day. There is simple form, button
and listgrid. Set values in the form e.g. name=xxx, birthdate=20011-09-30,
click button and see what date is in alert (SC.say()) and what date is in url
which try to request resource. In both the date is minus one day to given in
form
Original comment by mateusz....@javart.eu
on 30 Sep 2011 at 3:06
Attachments:
and one more: there is no toString(), no debugging, only smartgwt code used.
Original comment by mateusz....@javart.eu
on 30 Sep 2011 at 3:09
also giving a screenshot
Original comment by mateusz....@javart.eu
on 30 Sep 2011 at 3:16
Attachments:
This code is also incorrect. For a field of type "date", the time value is
stored as noon and should be ignored. When serialized to JSON in the absence
of a DataSource to provide any type information for fields, this time value is
included. If you declare the field as type "date" in the RestDataSource it
would be omitted.
In the JSONEncoder, in the absence of any type information for the value,
SmartGWT serializes as UTC. Your timezone appears to be far enough from GMT to
actually change the day value.
Original comment by smartgwt...@gmail.com
on 4 Oct 2011 at 12:33
Original issue reported on code.google.com by
mateusz....@javart.eu
on 17 Sep 2011 at 1:21