Appboard/2.4/builder/client date formats: Difference between revisions

imported>Jason.nicholls
No edit summary
imported>Jason.nicholls
No edit summary
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{DISPLAYTITLE:Client Date Formats}}
{{DISPLAYTITLE:Client Date Formats}}
 
[[Category:AppBoard 2.4]]
The Builder provides a number of places for an administrator to specify the date format shown to end-users:
The Builder provides a number of places for an administrator to specify the date format shown to end-users:


* [[appboard/2.4/builder/widgets/table|Table Widget]]: date column renderer
* [[appboard/2.4/builder/widgets/table|Table Widget]]: date column renderer
* [[appboard/2.4/builder/widgets/actions/show_data_tip|Show Data Tip]] widget action: date renderer for <tt>DATE</tt> field types
* [[appboard/2.4/builder/widgets/actions/show_data_tip|Show Data Tip]] widget action: date renderer for <tt>DATE</tt> field types
* Charts that support DateTimeAxis


This is configurable via configuration file which is included in backup archives and so should be retained through migrations and upgrades:
This is configurable via configuration file which is included in backup archives and so should be retained through migrations and upgrades:
Line 32: Line 33:




== Formatting Letters ==
== Formatting Codes ==


{|class='wikitable'
{|class='wikitable'
Line 40: Line 41:
|Y     
|Y     
|Year. If the number of pattern letters is two, the year is truncated to two digits; otherwise, it appears as four digits. The year can be zero-padded, as the third example shows in the following set of examples:
|Year. If the number of pattern letters is two, the year is truncated to two digits; otherwise, it appears as four digits. The year can be zero-padded, as the third example shows in the following set of examples:
YY = 05
* YY = 05
YYYY = 2005
* YYYY = 2005
YYYYY = 02005
* YYYYY = 02005
|-
|-
|M
|M
Line 50: Line 51:
If the number of pattern letters is three, the format is interpreted as short text.
If the number of pattern letters is three, the format is interpreted as short text.
If the number of pattern letters is four, the format is interpreted as full text.
If the number of pattern letters is four, the format is interpreted as full text.
Examples:
Examples:
M = 7
* M = 7
MM= 07
* MM= 07
MMM=Jul
* MMM=Jul
MMMM= July
* MMMM= July
|-
|-
|D
|D
|Day in month. While a single-letter pattern string for day is valid, you typically use a two-letter pattern string.
|Day in month. While a single-letter pattern string for day is valid, you typically use a two-letter pattern string.
Examples:
Examples:
 
* D=4
D=4
* DD=04
DD=04
* DD=10
DD=10
|-
|-
|E
|E
Line 71: Line 73:
If the number of pattern letters is four, the format is interpreted as full text.
If the number of pattern letters is four, the format is interpreted as full text.
Examples:
Examples:
E = 1
* E = 1
EE = 01
* EE = 01
EEE = Mon
* EEE = Mon
EEEE = Monday
* EEEE = Monday
|-
|-
|A ||  am/pm indicator.
|A ||  am/pm indicator.
Line 88: Line 90:
|N || Minute in hour.
|N || Minute in hour.
Examples:
Examples:
 
* N = 3
N = 3
* NN = 03
NN = 03
|-
|-
|S || Second in minute.
|S || Second in minute.
Example:
Example:
 
* SS = 30
SS = 30
|-
|-
|Q || Millisecond in second
|Q || Millisecond in second
Example:
Example:
 
* QQ = 78
QQ = 78
* QQQ = 078
QQQ = 078
|-
|-
|Other text || You can add other text into the pattern string to further format the string. You can use punctuation, numbers, and all lowercase letters. You should avoid uppercase letters because they may be interpreted as pattern letters.
|Other text || You can add other text into the pattern string to further format the string. You can use punctuation, numbers, and all lowercase letters. You should avoid uppercase letters because they may be interpreted as pattern letters.
Example:
Example:
 
* EEEE, MMM. D, YYYY at L:NN:QQQ A = Tuesday, Sept. 8, 2005 at 1:26:012 PM
EEEE, MMM. D, YYYY at L:NN:QQQ A = Tuesday, Sept. 8, 2005 at 1:26:012 PM
|}
|}

Latest revision as of 13:29, 1 April 2014

The Builder provides a number of places for an administrator to specify the date format shown to end-users:

  • Table Widget: date column renderer
  • Show Data Tip widget action: date renderer for DATE field types
  • Charts that support DateTimeAxis

This is configurable via configuration file which is included in backup archives and so should be retained through migrations and upgrades:

[INSTALL_HOME]/server/webapps/enportal/WEB-INF/xmlroot/appboard/config/dateformats.xml

Example content from the default dateformats.xml file:

[xml,N] <?xml version="1.0" encoding="UTF-8"?> <configuration>

   <obj className="appboard.formats">
       <association name="formats">
           <obj className="appboard.formats.DateFormat"
                format="YYYY/MM/DD JJ:NN:SS"/>
           <obj className="appboard.formats.DateFormat"
                format="YYYY-MMM-DD JJ:NN:SS"/>
           ...
       </association>
   </obj>

</configuration>


Formatting Codes

Pattern letter Description
Y Year. If the number of pattern letters is two, the year is truncated to two digits; otherwise, it appears as four digits. The year can be zero-padded, as the third example shows in the following set of examples:
  • YY = 05
  • YYYY = 2005
  • YYYYY = 02005
M Month in year. The format depends on the following criteria:

If the number of pattern letters is one, the format is interpreted as numeric in one or two digits. If the number of pattern letters is two, the format is interpreted as numeric in two digits. If the number of pattern letters is three, the format is interpreted as short text. If the number of pattern letters is four, the format is interpreted as full text.

Examples:

  • M = 7
  • MM= 07
  • MMM=Jul
  • MMMM= July
D Day in month. While a single-letter pattern string for day is valid, you typically use a two-letter pattern string.

Examples:

  • D=4
  • DD=04
  • DD=10
E Day in week. The format depends on the following criteria:

If the number of pattern letters is one, the format is interpreted as numeric in one or two digits. If the number of pattern letters is two, the format is interpreted as numeric in two digits. If the number of pattern letters is three, the format is interpreted as short text. If the number of pattern letters is four, the format is interpreted as full text. Examples:

  • E = 1
  • EE = 01
  • EEE = Mon
  • EEEE = Monday
A am/pm indicator.
J Hour in day (0-23).
H Hour in day (1-24).
K Hour in am/pm (0-11).
L Hour in am/pm (1-12).
N Minute in hour.

Examples:

  • N = 3
  • NN = 03
S Second in minute.

Example:

  • SS = 30
Q Millisecond in second

Example:

  • QQ = 78
  • QQQ = 078
Other text You can add other text into the pattern string to further format the string. You can use punctuation, numbers, and all lowercase letters. You should avoid uppercase letters because they may be interpreted as pattern letters.

Example:

  • EEEE, MMM. D, YYYY at L:NN:QQQ A = Tuesday, Sept. 8, 2005 at 1:26:012 PM