From ffd23476fcb3ad391acf6e5e3291e1cc3f805163 Mon Sep 17 00:00:00 2001 From: andryyy Date: Fri, 10 Apr 2020 21:00:46 +0200 Subject: [PATCH] [Web] Date formats --- data/web/js/site/admin.js | 20 +------------------- data/web/js/site/user.js | 4 ++-- 2 files changed, 3 insertions(+), 21 deletions(-) diff --git a/data/web/js/site/admin.js b/data/web/js/site/admin.js index 62a918dfc..43726b1db 100644 --- a/data/web/js/site/admin.js +++ b/data/web/js/site/admin.js @@ -45,24 +45,6 @@ jQuery(function($){ mailcow_alert_box('Regex OK', 'success'); $('button[data-id="' + regex_map_id + '"]').attr({"disabled": false}); } - }); - $('.btn-api-ro').click(function() { - $('#api_rw').hide() - $('#api_ro').show() - $(this).addClass('active') - $('.btn-api-rw, .btn-api-hide').removeClass('active') - }); - $('.btn-api-rw').click(function() { - $('#api_ro').hide() - $('#api_rw').show() - $(this).addClass('active') - $('.btn-api-ro, .btn-api-hide').removeClass('active') - }); - $('.btn-api-hide').click(function() { - $('#api_ro').hide() - $('#api_rw').hide() - $(this).addClass('active') - $('.btn-api-ro, .btn-api-rw').removeClass('active') }); $('.textarea-code').on('keyup', function() { $('.submit_rspamd_regex').attr({"disabled": true}); @@ -259,7 +241,7 @@ jQuery(function($){ {"name":"chkbox","title":"","style":{"maxWidth":"60px","width":"60px"},"filterable": false,"sortable": false,"type":"html"}, {"name":"queue_id","type":"text","title":"QID","style":{"width":"50px"}}, {"name":"queue_name","type":"text","title":"Queue","style":{"width":"120px"}}, - {"name":"arrival_time","sorted": true,"direction": "DESC","formatter":function unix_time_format(tm) { var date = new Date(tm ? tm * 1000 : 0); return date.toLocaleString();},"title":lang.arrival_time,"style":{"width":"170px"}}, + {"name":"arrival_time","sorted": true,"direction": "DESC","formatter":function unix_time_format(tm) { var date = new Date(tm ? tm * 1000 : 0); return date.toLocaleDateString(undefined, {year: "numeric", month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit", second: "2-digit"});},"title":lang.arrival_time,"style":{"width":"170px"}}, {"name":"message_size","style":{"whiteSpace":"nowrap"},"title":lang.message_size,"formatter": function(value){ return humanFileSize(value); }}, diff --git a/data/web/js/site/user.js b/data/web/js/site/user.js index cabc595b8..f320983b5 100644 --- a/data/web/js/site/user.js +++ b/data/web/js/site/user.js @@ -38,7 +38,7 @@ jQuery(function($){ } function unix_time_format(tm) { var date = new Date(tm ? tm * 1000 : 0); - return date.toLocaleString(); + return date.toLocaleDateString(undefined, {year: "numeric", month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit", second: "2-digit"}); } acl_data = JSON.parse(acl); var last_login = $('.last_login_date').data('time'); @@ -49,7 +49,7 @@ jQuery(function($){ "columns": [ {"name":"chkbox","title":"","style":{"maxWidth":"40px","width":"40px","text-align":"center"},"filterable": false,"sortable": false,"type":"html"}, {"sorted": true,"name":"address","title":lang.alias}, - {"name":"validity","formatter":function unix_time_format(tm) { var date = new Date(tm ? tm * 1000 : 0); return date.toLocaleString();},"title":lang.alias_valid_until,"style":{"width":"170px"}}, + {"name":"validity","formatter":function unix_time_format(tm) { var date = new Date(tm ? tm * 1000 : 0); return date.toLocaleDateString(undefined, {year: "numeric", month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit", second: "2-digit"});},"title":lang.alias_valid_until,"style":{"width":"170px"}}, {"name":"action","filterable": false,"sortable": false,"style":{"text-align":"right","maxWidth":"180px","width":"180px"},"type":"html","title":lang.action,"breakpoints":"xs sm"} ], "empty": lang.empty,