-
18 Jan 2011 2:56 AM #1
[CLOSED] Bug in com.extjs.gxt.ui.client.util.DateWrapper
[CLOSED] Bug in com.extjs.gxt.ui.client.util.DateWrapper
Well, dudes, 12AM is not the actual start of the date (at least not in the USA or GB ).
Must be date.setHours(0);Code:public DateWrapper resetTime() { Date date = asDate(); // remove millis long msec = date.getTime(); msec = (msec / 1000) * 1000; date.setTime(msec); // reset time to 12am date.setHours(12); date.setMinutes(0); date.setSeconds(0); return new DateWrapper(date); }
-
18 Jan 2011 10:59 AM #2
This is not a bug, The method is exactly doing what it should do. You are probably looking for clearTime() or an own method that serves your needs
-
18 Jan 2011 2:10 PM #3
OK. Let's do it the hard way.
That method called from com.extjs.gxt.ui.client.widget.DatePicker
And that method setValue called every time user clicked on 'day' in DatePicker.Code:public void setValue(Date date, boolean supressEvent) { this.value = new DateWrapper(date).resetTime(); if (rendered) { update(value); } if (!supressEvent) { DatePickerEvent de = new DatePickerEvent(this); de.setDate(date); fireEvent(Events.Select, de); } }
After changing day I got "19.01.2011 12:00:00". But it must be "19.01.2011 00:00:00"!
-
18 Jan 2011 2:12 PM #4
And so
And so
At least there must be the way to change that behaviour.
We expects that new day (just day without time) starts from midnight.
Method setValue firing event with correct date (without 12am starting). But com.extjs.gxt.ui.client.widget.form.DateField ignores that date in event. This class using getValue from DatePicker holding 12am date.
P.S. Maybe I'm wrong with that expectation. Just another overwritten GXT class to our code
-
2 Aug 2011 2:27 PM #5
I think the docs should at least be changed. 12:00:00 (what it's reset to) is not 12 am. It's 12 pm (i.e. noon). 12 am is the start of the day (i.e. midnight).
-
2 Aug 2011 11:38 PM #6
Thank you for reporting this bug. We will make it our priority to review this report.
Similar Threads
-
com.extjs.gxt.ui.client.data.BaseListLoadResult cannot be cast to com.extjs.gxt.ui.cl
By ishak1981 in forum Ext GWT: DiscussionReplies: 2Last Post: 27 Sep 2010, 9:25 AM -
[CLOSED] Bug in DateWrapper.addMonths
By tikvar in forum Ext GWT: Bugs (2.x)Replies: 1Last Post: 29 Mar 2010, 6:08 AM -
[FIXED] Bug in class com.extjs.gxt.ui.client.widget.Component
By raidan2 in forum Ext GWT: Bugs (2.x)Replies: 2Last Post: 26 Nov 2009, 9:31 AM -
using com.extjs.gxt.ui.client.fx.Resizable
By safisoft13 in forum Ext GWT: Help & Discussion (1.x)Replies: 4Last Post: 12 Mar 2009, 3:18 PM -
Trunk: com.extjs.gxt.ui.client.GXT can't find gray theme
By jbaxter in forum Ext GWT: Bugs (1.x)Replies: 0Last Post: 9 Feb 2009, 8:43 AM


Reply With Quote