Overview
The recommended type to use for date sorting is the M column type. The support for M type date sorting support is built in including multiple language support and does not require any additional server installation.
...
Info | ||
---|---|---|
| ||
Advanced date sorting support with the 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 Moment.js documentation is repeated here. |
Automatic support
On specifying just the M column type, default date parsing recognizes a number of common date formats including those recognized by the browser specific Javascript implementation. However, there can 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
On specifying a format string following the M column type, 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 this example, both of the following are treated the same with the MM-DD-YYYY format:
Similarly, formats can be specified with or with non-alphanumeric separators. However, using separators helps with readability. |
Format tokens
Info |
---|
See the Moment.js documentation for further information. |
...
Token | Description | ||
---|---|---|---|
M, MM | Month Number (1 - 12) | ||
MMM, MMMM | Month Name (In 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, returns 1900's; else, 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 contains any other language words, the appropriate language must be indicated. English (US) is the default if nothing is specified. The language is specified by following the M with (language indicator) prior to the format string.
Examples
- M(de)YYYY-MMM-DD for a German date: 2013-Mrz-10
- M(fr) for a French date: Janv 10, 2013
Supported languages
Click the link, in the following list of languages supported by the Moment.js library, to get the details of the specific localization:
...