Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Div
idProductTOC

On this page

Table of Contents
maxLevel1
excludeOn this page
typeflat
separatorpipe

Overview

On plugin versions 6.x and higher, advanced date sorting for a column is available by specifying the Date (M) column type. An older alternative is available for all plugin versions, but more specifically 5.x and lower, see How to Advanced perform advanced date sorting using the D column type. The  The support for Date (M) type date sorting support is built in including multiple language support and does not require any additional server installation - this is the recommended type to use for date sorting.

Tip
titleHow to know if the M column type is available on my Confluence

In the Macro Browserbrowser, search for the Table Plus macro and find the Column types parameter. If Date (M) is listed in the help text, then it is available for use.


Info
titleAcknowledgement

Advanced date sorting support with the Date (M) column type is provided using javascript JavaScript implemented by the Table Library for Bob Swift Apps with the help of the Moment.js library (open source, MIT license). A summary of the relevant parts of the moment.js documentation is repeated here.

Automatic support

By specifying just the Date (M) column type, the default date parsing will recognize recognizes a number of common date formats including those recognized by the browser specific javascript JavaScript implementation. However, there may be browser specific inconsistencies. The following ISO-8601 formats are recognized consistently across browsers:

Csv
ISO-8601 Format
YYYY-MM-DD
YYYY-MM-DDTHH
YYYY-MM-DD HH
YYYY-MM-DDTHH:mm
YYYY-MM-DD HH:mm
YYYY-MM-DDTHH:mm:ss
YYYY-MM-DD HH:mm:ss
YYYY-MM-DDTHH:mm:ss.SSS
YYYY-MM-DD HH:mm:ss.SSS
YYYY-MM-DDTHH:mm:ss Z
YYYY-MM-DD HH:mm:ss Z

User

...

specified formats

By specifying a format string following the Date (M) column type, a specific date format can be handled. Construct the date format string from the set of format tokens.

Tip
titleNon-alphanumeric characters

NonNon-alphanumeric characters are ignored, so, for example, both of the following will be are treated the same using format: the MM-DD-YYYYYYYY format:

No Format
12-25-1995
12/25/1995

Similarly, formats can be specified with or with non-alphanumeric separators. However, using separators helps with readability.

Format tokens

(info) See the Momentmoment.js documentation for further information.

TokenDescription
M, MMMonth Number (1 - 12)
MMM, MMMMMonth Name (In current language)
D, DDDay of month
DDD, DDDDDay of year
d, dd, ddd, ddddDay of week (NOTE: the input for these tokens is ignored, as there are 4-5 weeks in a month, and it would be impossible to get the day of the month based off the day of the week)
YY2 digit year (if greater than 68 will return 1900's, otherwise 2000's)
YYYY4 digit year
a, AAM/PM
H, HH24 hour time
h, hh12 hour time (use in conjunction with a or A)
m, mmMinutes
s, ssSeconds
SDeciseconds (1/10th of a second)
SSCentiseconds (1/100th of a second)
SSSMilliseconds (1/1000th of a second)
Z, ZZTimezone offset as +07:00 or +0700
XUnix timestamp

Language support (i18n)

When date format contain national language words, the appropriate language needs to be indicated. English (US) is the default if nothing is specified. The language is specified by following the Date (M) with (lang indicator) prior to the format string.

Example: M(de)YYYY-MMM-DD for a German date like: 2013-Mrz-10 10

Example: M(fr) for a French date like Janv 10, 2013

Supported languages

The following is a list of languages supported by the Moment.js library. Click on the link to get the details of the specific localization.

...