From f82d50b56e27fe4df6e07f74a740284d5cbde352 Mon Sep 17 00:00:00 2001
From: Pat O'Brien <3484775+poblabs@users.noreply.github.com>
Date: Thu, 3 Oct 2019 10:24:29 -0400
Subject: [PATCH] Use moment.js for date formatting
---
example.config.ini | 5 ++++-
web/api.php | 1 +
web/index.html | 1 +
web/js/moment-with-locales.min.js | 1 +
web/js/opentrashmail.js | 6 ++++--
5 files changed, 11 insertions(+), 3 deletions(-)
create mode 100644 web/js/moment-with-locales.min.js
diff --git a/example.config.ini b/example.config.ini
index 24f67ba..ca74072 100644
--- a/example.config.ini
+++ b/example.config.ini
@@ -10,4 +10,7 @@ DOMAINS=yourdomain,sub.yourdomain
[MAILSERVER]
; Port that the Mailserver will run on (default 25 but that needs root)
-MAILPORT=25
\ No newline at end of file
+MAILPORT=25
+[DATETIME]
+; The moment.js format you'd like your date to be formatted in
+DATEFORMAT="D.M.YYYY HH:mm"
\ No newline at end of file
diff --git a/web/api.php b/web/api.php
index d37e95b..2300d04 100644
--- a/web/api.php
+++ b/web/api.php
@@ -60,6 +60,7 @@ switch($action)
{
$o['status'] = 'ok';
$o['type'] = 'admin';
+ $o['dateformat'] = $settings['DATEFORMAT'];
$emails = listEmailAdresses();
$emaillist = array();
diff --git a/web/index.html b/web/index.html
index 01471e1..a16805d 100644
--- a/web/index.html
+++ b/web/index.html
@@ -42,5 +42,6 @@
+