Skip to main content



      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 09:11 Go to next message
Eclipse UserFriend
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 09:53 Go to previous messageGo to next message
Eclipse UserFriend
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 10:57 Go to previous messageGo to next message
Eclipse UserFriend
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 11:21 Go to previous messageGo to next message
Eclipse UserFriend
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 02:56 Go to previous message
Eclipse UserFriend
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: Mon Jul 14 08:52:35 EDT 2025

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

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

Back to the top