mailcow/data/web
Tom Udding 240b2c63f6
Fix timestamps not sorting in datatables
Timestamps retrieved from the API were always converted to a browser
local format. The format specified for moment.js added in
5160eff294 did not work because of this.

Additionally, the format specified used `dd` which looks for two letter
days, such as "Mo", "Tu", "We", etc. Furthermore, `mm` is used for
minutes, not months.

Because the locale formatted datetime can vary a lot, it is not easy to
get this into moment.js to enable the sorting of datetimes in the
datatables. In other words, there is no conversion from an
`Intl.DateTimeFormat` specifier string to moment.js. Adding many
`$.fn.dataTable.moment(format);` with different `format`s is not useful.

I have fixed this rewriting how the timestamps from the API are added
to the tables. It still uses the locale of the browser, because not
everyone wants to use ISO 8601, but no longer requires moment.js (which
has been removed).

Two data attributes are added to the `td`s of the timestamps:
- `data-order`
- `data-sort`

The values of these are the timestamps as returned by the server, which
are very easily sorted (as they are just UNIX timestamps). Then, when
creating the cell in the table, it will be converted to what the locale
of the browser specified (this has not changed).
2022-12-24 17:35:31 +01:00
..
api Added SENDER_ADDRESS and SENDER_NAME as variables for messages 2022-11-17 21:01:18 +01:00
css Merge pull request #4657 from tomy0000000:master 2022-10-20 11:27:58 +02:00
fonts
img
inc Updated DB Schemata + reverted escape HTML of alert boxes 2022-12-23 14:47:27 +01:00
js Fix timestamps not sorting in datatables 2022-12-24 17:35:31 +01:00
lang Translations update from Weblate (#4909) 2022-12-24 11:48:08 +01:00
oauth
templates Merge remote-tracking branch 'origin/feature/bootstrap5' into staging 2022-12-23 16:46:00 +01:00
_rspamderror.php
_status.502.html Use built in compose 2022-12-16 13:57:13 +01:00
admin.php move guid to debug.php 2022-09-30 11:38:43 +02:00
autoconfig.php
autodiscover-json.php
autodiscover.php
debug.php shift get_public_ips to json_api.php 2022-10-11 17:40:46 +02:00
edit.php add template feature for domains and mailboxes 2022-11-10 16:22:18 +01:00
favicon.png
index.php
json_api.php add template feature for domains and mailboxes 2022-11-10 16:22:18 +01:00
mailbox.php add template feature for domains and mailboxes 2022-11-10 16:22:18 +01:00
mobileconfig.php
qhandler.php
quarantine.php
queue.php Fixed queue message error 2022-10-18 14:19:51 +02:00
resource.php
robots.txt
sogo-auth.php
user.php Merge branch 'nightly' into feature/bootstrap5 2022-08-29 14:37:25 +02:00