Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Scout » DateTimeColumn Format(How to change the DateTime format of a column ?)
DateTimeColumn Format [message #1717890] Thu, 17 December 2015 14:11 Go to next message
Olivier Durand is currently offline Olivier DurandFriend
Messages: 3
Registered: December 2015
Junior Member
Hi,

In a mysql table the field looks like this :

'2015-12-17 15:05:01'

and then, in Scout, the same field :

'17.12.15 15:05'

Where is the place in Scout to manage the column Date Time format??

Tx for your help,

Re: DateTimeColumn Format [message #1717897 is a reply to message #1717890] Thu, 17 December 2015 14:53 Go to previous messageGo to next message
Matthias Zimmermann is currently offline Matthias ZimmermannFriend
Messages: 208
Registered: June 2015
Senior Member
please check out the Scout widget demoapp [1]. click on entry "Date & Time Fields" in the widget list. in the form that appears you can try the button "Now" then "Sample Format".

the corresponding code is hosted on github [2], and as you can see in method updateDateTimeFields you have to use the setFormat method. as for the possible format options you may want to consult the javadoc for class SimpleDateFormat [3].

[1] https://scout.bsiag.com/demoapp/web
[2] https://github.com/BSI-Business-Systems-Integration-AG/org.eclipse.scout.docs/blob/releases/5.0.x/code/widgets/org.eclipsescout.demo.widgets.client/src/org/eclipsescout/demo/widgets/client/ui/forms/DateTimeFieldsForm.java
[3] http://docs.oracle.com/javase/8/docs/api/java/text/SimpleDateFormat.html
Re: DateTimeColumn Format [message #1717902 is a reply to message #1717897] Thu, 17 December 2015 15:57 Go to previous messageGo to next message
Olivier Durand is currently offline Olivier DurandFriend
Messages: 3
Registered: December 2015
Junior Member
Thank you for the answer.

I was talking about field, my mistake. In fact, I would said column content in a table.

Could you please explain me where have I to put such a set format for an entire column in a table.

Tx for your help,

Re: DateTimeColumn Format [message #1717905 is a reply to message #1717902] Thu, 17 December 2015 16:21 Go to previous messageGo to next message
Matthias Zimmermann is currently offline Matthias ZimmermannFriend
Messages: 208
Registered: June 2015
Senior Member
in scout form fields and corresponding columns work the same or almost the same.

this means that you can use getConfiguredFormat on both the form field and your column type. just make the method return the desired format string.
Re: DateTimeColumn Format [message #1718192 is a reply to message #1717905] Mon, 21 December 2015 07:56 Go to previous message
Olivier Durand is currently offline Olivier DurandFriend
Messages: 3
Registered: December 2015
Junior Member
Hello,

Thank you very much for the answer.

With the informations you provide, I did it as follow:

In All Pages -> My Page -> Table -> Column -> My DateTime Column

Override the getConfiguredFormat method like this:

@Override
protected String getConfiguredFormat() {
return "Y-M-d HH:mm:ss";
}

And it works perfectly well.

Thank you again for your help.

Previous Topic:[Blog Post] Scout goes Java and HTML5
Next Topic:[Blog Post] Oomph Blog post series...
Goto Forum:
  


Current Time: Wed Sep 25 16:06:38 GMT 2024

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

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

Back to the top