Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » DateTime-Widget not reliable(What you see is NOT what you get. DateTime displays correct date, but "getDay" delivers wrong/old digit.)
DateTime-Widget not reliable [message #537428] Wed, 02 June 2010 12:34 Go to next message
Bassspieler  is currently offline Bassspieler Friend
Messages: 40
Registered: April 2010
Location: Germany
Member
Hi!

My DateTime-Widgets from RAP 1.3 RC2 act strange. I initialize them with the current date '2010-06-02'. Then I click into the spinner for months and type '01'. Then I click into the spinner for days and type '031' to get the 31th of january.

When I read the date from the wiget I get '2010-02-01'. It just "works" for the number 31, but any of the 31-months.

[Updated on: Mon, 12 July 2010 11:03]

Report message to a moderator

Re: DateTime - Bug? [message #537818 is a reply to message #537428] Thu, 03 June 2010 17:49 Go to previous messageGo to next message
Rüdiger Herrmann is currently offline Rüdiger HerrmannFriend
Messages: 581
Registered: July 2009
Senior Member
I couldn't reproduce what you describe. You would expect 2010-01-31 as a
result, right?
However, you should file a bug if you think it is one. Please provide
further information if possible.

Regards
Rüdiger

On 02.06.2010 14:34, Bassspieler wrote:
> Hi!
>
> My DateTime-Widgets from RAP 1.3 RC2 act strange. I initialize them with
> the current date '2010-06-02'. Then I click into the spinner for months
> and type '01'. Then I click into the spinner for days and type '031' to
> get the 31th of january.
>
> When I read the date from the wiget I get '2010-02-01'. It just "works"
> for the number 31, but any of the 31-months.
icon4.gif  Re: DateTime - Bug? [message #543378 is a reply to message #537818] Tue, 29 June 2010 09:17 Go to previous messageGo to next message
Bassspieler  is currently offline Bassspieler Friend
Messages: 40
Registered: April 2010
Location: Germany
Member
Ok, now it's already an open Bug.
https://bugs.eclipse.org/bugs/show_bug.cgi?id=315950
But I really do have to stress the importance of this, I guess.

(1)
DateTime-Widget initialized with "01.06.2010"
- Open drop-down-calendar
- Switch to May
- Select "31"
- Query the date from the DateTime-Widget
-> "01.05.2010" is your result (wrong)

But it get's even more strange.

(2a)
DateTime-Widget initialized with "01.05.2010"
- Open drop-down-calendar
- Switch to June
- Select "14"
- Query the date from DateTime-Widget
-> "14.06.2010" is your result
- Open drop-down-calendar
- Switch to may
- Select "31"
-> "14.05.2010" is your result (wrong)

(2b)
DateTime-Widget initialized with "01.05.2010"
- Open drop-down-calendar
- Switch to June
- Select "14"
- Do not Query the date from DateTime-Widget
- Open drop-down-calendar
- Switch to may
- Select "31"
-> "31.05.2010" is your result (right)

If you can reproduce this, than it's an absolutely critical bug for any running application, isn't it?
Or am I just using the DateTime-Widget the wrong way?

Best regards,
Bassspieler


Here is the snippet, that I used:

import org.eclipse.jface.dialogs.TrayDialog;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.DateTime; import org.eclipse.swt.widgets.Shell;

public class DateTimeDialog extends TrayDialog {

	private DateTime dtDate;

	public DateTimeDialog(Shell shell) {
		super(shell);
	}

	@Override
	protected Control createDialogArea(Composite parent) {

		dtDate = new DateTime(parent, SWT.DATE | SWT.DROP_DOWN | SWT.BORDER);
		dtDate.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false));
		dtDate.setDate(2010, 5, 1); // this is: "2010-06-01"

		return parent;
	}

	@Override
	protected void okPressed() {
		System.out.println(dtDate.getYear() 
			+ " " + (dtDate.getMonth() + 1) // to see the "human" month-digit
				+ " " + dtDate.getDay());
	}

}

[Updated on: Tue, 29 June 2010 09:28]

Report message to a moderator

Re: DateTime - Bug? [message #543384 is a reply to message #543378] Tue, 29 June 2010 09:27 Go to previous messageGo to next message
Bassspieler  is currently offline Bassspieler Friend
Messages: 40
Registered: April 2010
Location: Germany
Member
Very Happy
https://bugs.eclipse.org/bugs/show_bug.cgi?id=315950

Right the minute I did post my last message, some great guy posted the "fixed in CVS" in the bug-tracker. So, thanks to Ivan Furnadjiev.

Is there any way to integrate this into my application, asap?

Best regards,
Bassspieler
Re: DateTime - Bug? [message #543395 is a reply to message #543384] Tue, 29 June 2010 09:36 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2428
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Hi,

only one class is affected by this fix - DateTimeDateLCA. Changes are in
readData method.

HTH,
Ivan

On 06/29/2010 12:27 PM, Bassspieler wrote:
> :d https://bugs.eclipse.org/bugs/show_bug.cgi?id=315950
>
> Right the minute I did post my last message, some great guy posted the
> "fixed in CVS" in the bug-tracker. So, thanks to Ivan Furnadjiev.
>
> Is there any way to integrate this into my application, asap?
>
> Best regards,
> Bassspieler
Re: DateTime-Widget not reliable [message #543404 is a reply to message #537428] Tue, 29 June 2010 10:45 Go to previous messageGo to next message
Bassspieler  is currently offline Bassspieler Friend
Messages: 40
Registered: April 2010
Location: Germany
Member
Sorry, I never did change my used RAP runtime target. But I guess, it's all about creating a patch fragment, isn't it?

http://wiki.eclipse.org/RAP/Patch_Fragments
Re: DateTime-Widget not reliable [message #543439 is a reply to message #543404] Tue, 29 June 2010 12:57 Go to previous message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2428
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Yes, you can try it... The second approach is to work against the CVS
HEAD (RAP source).

Best,
Ivan

On 06/29/2010 1:45 PM, Bassspieler wrote:
> Sorry, I never did change my used RAP runtime target. But I guess,
> it's all about creating a patch fragment, isn't it?
>
> http://wiki.eclipse.org/RAP/Patch_Fragments
Previous Topic:a custom widget that make ajax call to communicate with the rap server
Next Topic:gc.drawImage()
Goto Forum:
  


Current Time: Wed Dec 04 18:59:08 GMT 2024

Powered by FUDForum. Page generated in 0.03172 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top