Use moment.js for date formatting
This commit is contained in:
parent
d2183dce4f
commit
f82d50b56e
|
@ -11,3 +11,6 @@ DOMAINS=yourdomain,sub.yourdomain
|
||||||
[MAILSERVER]
|
[MAILSERVER]
|
||||||
; Port that the Mailserver will run on (default 25 but that needs root)
|
; Port that the Mailserver will run on (default 25 but that needs root)
|
||||||
MAILPORT=25
|
MAILPORT=25
|
||||||
|
[DATETIME]
|
||||||
|
; The moment.js format you'd like your date to be formatted in
|
||||||
|
DATEFORMAT="D.M.YYYY HH:mm"
|
|
@ -60,6 +60,7 @@ switch($action)
|
||||||
{
|
{
|
||||||
$o['status'] = 'ok';
|
$o['status'] = 'ok';
|
||||||
$o['type'] = 'admin';
|
$o['type'] = 'admin';
|
||||||
|
$o['dateformat'] = $settings['DATEFORMAT'];
|
||||||
$emails = listEmailAdresses();
|
$emails = listEmailAdresses();
|
||||||
$emaillist = array();
|
$emaillist = array();
|
||||||
|
|
||||||
|
|
|
@ -42,5 +42,6 @@
|
||||||
<script src="js/namegenerator.js"></script>
|
<script src="js/namegenerator.js"></script>
|
||||||
<script src="js/opentrashmail.js"></script>
|
<script src="js/opentrashmail.js"></script>
|
||||||
<script src="js/bootstrap.bundle.min.js"></script>
|
<script src="js/bootstrap.bundle.min.js"></script>
|
||||||
|
<script src="js/moment-with-locales.min.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
1
web/js/moment-with-locales.min.js
vendored
Normal file
1
web/js/moment-with-locales.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
|
@ -106,8 +106,10 @@ function updateEmailTable()
|
||||||
}
|
}
|
||||||
else dateofemail = em;
|
else dateofemail = em;
|
||||||
if(em>lastid) lastid = em;
|
if(em>lastid) lastid = em;
|
||||||
var date = new Date(parseInt(dateofemail))
|
|
||||||
var datestring = date.getDate()+"."+date.getMonth()+"."+date.getFullYear()+" "+date.getHours()+":"+date.getMinutes();
|
//var date = new Date(parseInt(dateofemail))
|
||||||
|
//var datestring = date.getDate()+"."+date.getMonth()+"."+date.getFullYear()+" "+date.getHours()+":"+date.getMinutes();
|
||||||
|
var datestring = moment.unix(parseInt(dateofemail/1000)).format(data.dateformat); // Use moment.js formatting
|
||||||
var ed = data.emails[em]
|
var ed = data.emails[em]
|
||||||
$("#emailtable").append('\
|
$("#emailtable").append('\
|
||||||
<tr class="anemail" onClick="loadMail(\''+email+'\','+dateofemail+');">\
|
<tr class="anemail" onClick="loadMail(\''+email+'\','+dateofemail+');">\
|
||||||
|
|
Loading…
Reference in a new issue