Merge pull request #8 from poblabs/momentjs
Use moment.js for date formatting
This commit is contained in:
commit
f93063b4da
|
@ -36,6 +36,16 @@ fi
|
|||
echo "[MAILSERVER]" >> /var/www/opentrashmail/config.ini
|
||||
echo "MAILPORT=25" >> /var/www/opentrashmail/config.ini
|
||||
|
||||
echo "[DATETIME]" >> /var/www/opentrashmail/config.ini
|
||||
if [ "$DATEFORMAT" != "" ]; then
|
||||
echo "DATEFORMAT=$DATEFORMAT" >> /var/www/opentrashmail/config.ini
|
||||
echo " [i] Setting up dateformat to: $DATEFORMAT"
|
||||
else
|
||||
echo "DATEFORMAT='D.M.YYYY HH:mm'" >> /var/www/opentrashmail/config.ini
|
||||
echo " [i] Using default dateformat"
|
||||
fi
|
||||
|
||||
|
||||
cd /var/www/opentrashmail/python
|
||||
|
||||
echo ' [+] Starting Mailserver'
|
||||
|
|
|
@ -11,3 +11,6 @@ DOMAINS=yourdomain,sub.yourdomain
|
|||
[MAILSERVER]
|
||||
; Port that the Mailserver will run on (default 25 but that needs root)
|
||||
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['type'] = 'admin';
|
||||
$o['dateformat'] = $settings['DATEFORMAT'];
|
||||
$emails = listEmailAdresses();
|
||||
$emaillist = array();
|
||||
|
||||
|
|
|
@ -42,5 +42,6 @@
|
|||
<script src="js/namegenerator.js"></script>
|
||||
<script src="js/opentrashmail.js"></script>
|
||||
<script src="js/bootstrap.bundle.min.js"></script>
|
||||
<script src="js/moment-with-locales.min.js"></script>
|
||||
</body>
|
||||
</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
|
@ -111,8 +111,10 @@ function updateEmailTable()
|
|||
}
|
||||
else dateofemail = 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]
|
||||
$("#emailtable").append('\
|
||||
<tr class="anemail" onClick="loadMail(\''+email+'\','+dateofemail+');">\
|
||||
|
|
Loading…
Reference in a new issue