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 perform advanced date sorting using the D column type. The support for Date (M) type date sorting support is built in including which includes multiple language support and does not require any additional server installation - this . This is the recommended type to use for date sorting.
...
title | How to know if the M column type is available on my Confluence |
---|
...
.
Info | ||
---|---|---|
| ||
Advanced date sorting support with the Date (M) column type is provided using 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 momentMoment.js documentation is repeated here. |
Automatic support
By specifying just If the Date (M) column type is specified, the default date parsing recognizes a number of common date formats including those recognized by through the browser specific 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 Specify a format string following the Date (M) column type , to handle a specific date format can be handled. Construct the date format string from the set of format tokens.
Tip | ||
---|---|---|
| ||
Non-alphanumeric characters are ignored, so, for example, both of the following are treated the same using the MM-DD-YYYY format:
Similarly, formats can be specified with or with non-alphanumeric separators. However, using separators helps with readability. |
Format tokens
See the momentMoment.js documentation for further information.
Token | Description | |||||
---|---|---|---|---|---|---|
M, MM | Month Number (1 - 12) | |||||
MMM, MMMM | Month Name (In the current language) | |||||
D, DD | Day of month | |||||
DDD, DDDD | Day of year | |||||
d, dd, ddd, dddd | Day of week
| |||||
YY | 2 digit year (if greater than 68 will return , it returns 1900's, otherwise 2000's) | |||||
YYYY | 4 digit year | |||||
a, A | AM/PM | |||||
H, HH | 24 hour time | |||||
h, hh | 12 hour time (use in conjunction with a or A) | |||||
m, mm | Minutes | |||||
s, ss | Seconds | |||||
S | Deciseconds (1/10th of a second) | |||||
SS | Centiseconds (1/100th of a second) | |||||
SSS | Milliseconds (1/1000th of a second) | |||||
Z, ZZ | Timezone offset as +07:00 or +0700 | |||||
X | Unix timestamp |
Language support (i18n)
When the date format contain contains 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 Specify the language between the date indicator M and the format string.
ExampleFor example: M (de)YYYY-MMM-DD for a German date like: like 2013-Mrz-10Example: M
(fr) for a French date like Janv 10, 2013
Supported languages
The following is a list of languages supported by the MomentClick the relevant link from the following list of Moment.js library . Click the link supported languages to get the details of the specific localization.:
Language indicator |
---|
ar-ma |
ar |
bg |
br |
ca |
cs |
cv |
da |
de |
el |
en-ca |
en-gb |
eo |
es |
et |
eu |
fa |
fi |
fr-ca |
fr |
gl |
he |
hi |
hu |
id |
is |
it |
ja |
ka |
ko |
lv |
ms-my |
nb |
ne |
nl |
nn |
pl |
pt-br |
pt |
ro |
ru |
sk |
sl |
sq |
sv |
th |
tr |
tzm-la |
tzm |
uk |
zh-cn |
zh-tw |
...