Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » How To set Dataformat for DateTime widget
How To set Dataformat for DateTime widget [message #652853] Mon, 07 February 2011 11:29 Go to next message
ash is currently offline ashFriend
Messages: 142
Registered: July 2010
Senior Member
Hi

How To set Dataformat for DateTime widget

Thanks
Ashok
Re: How To set Dataformat for DateTime widget [message #652914 is a reply to message #652853] Mon, 07 February 2011 15:12 Go to previous messageGo to next message
Grant Gayed is currently offline Grant GayedFriend
Messages: 2151
Registered: July 2009
Senior Member
Assuming you mean how to specify the format that a date or time is displayed
in, this is done by setting the appropriate style bit(s) when creating the
DateTime. The relevant javadoc from DateTime is:

* <dt><b>Styles:</b></dt>
* <dd>DATE, TIME, CALENDAR, SHORT, MEDIUM, LONG, DROP_DOWN</dd>
* </dl>
* <p>
* Note: Only one of the styles DATE, TIME, or CALENDAR may be specified,
* and only one of the styles SHORT, MEDIUM, or LONG may be specified.
* The DROP_DOWN style is a <em>HINT</em>, and it is only valid with the
DATE style.
* </p><p>

SHORT/MEDIUM/LONG mean show the least/more/most info about the date or time.

If you're asking about changing this style for an existing DateTime
instance, this is not currently supported. I could not find an existing
request for this, so if this is what you wanted then you can log a feature
request with swt at
https://bugs.eclipse.org/bugs/enter_bug.cgi?product=Platform &component=SWT&bug_severity=enhancement .

Grant


"ash" <ashok_kumar_rr@yahoo.com> wrote in message
news:iioknp$tsj$1@news.eclipse.org...
> Hi
> How To set Dataformat for DateTime widget
>
> Thanks
> Ashok
Re: How To set Dataformat for DateTime widget [message #652944 is a reply to message #652914] Mon, 07 February 2011 17:22 Go to previous messageGo to next message
ash is currently offline ashFriend
Messages: 142
Registered: July 2010
Senior Member
Hi

i want set date in dd/mm/yyyy format how to do that ?

By default its is taking mm/dd/yyyy

thanks
ashok

[Updated on: Mon, 07 February 2011 17:30]

Report message to a moderator

Re: How To set Dataformat for DateTime widget [message #653122 is a reply to message #652944] Tue, 08 February 2011 15:10 Go to previous message
Grant Gayed is currently offline Grant GayedFriend
Messages: 2151
Registered: July 2009
Senior Member
If you create the DateTime with style SWT.DATE | SWT.LONG then the control
should contain this information. Whether it's in the format of dd/mm/yyyy
or not depends on the user's locale settings in the OS. There isn't a way
for you to specify that DateTime use a format that differs from the format
that is picked up natively.

Grant


"ash" <ashok_kumar_rr@yahoo.com> wrote in message
news:iip9ci$33k$1@news.eclipse.org...
> Hi
>
> i want set date in dd/mm/yyyy format how to do that ?
>
> thanks
> ashok
>
Previous Topic:CommandContributionItem is never disposed when it's placed at drop down menu from toolbar item.
Next Topic:branding win32/linux rcp using ant
Goto Forum:
  


Current Time: Fri Dec 19 10:22:21 GMT 2014

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

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