aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNateScarlet <NateScarlet@Gmail.com>2019-03-20 09:27:49 +0800
committerLunny Xiao <xiaolunwen@gmail.com>2019-03-20 09:27:49 +0800
commitb78cbbcaa25d03d07b77a010a26568182682c6f1 (patch)
tree8e1f487a8b6895f5d8870cf67135471259636beb
parentf125330fcf89550e380057d69dae61871b5b0c8b (diff)
downloadgitea-b78cbbcaa25d03d07b77a010a26568182682c6f1.tar.gz
gitea-b78cbbcaa25d03d07b77a010a26568182682c6f1.zip
Show locale string on timestamp (#6324)
Resolve #6004
-rw-r--r--public/js/index.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/public/js/index.js b/public/js/index.js
index a34904abba..77b2f23370 100644
--- a/public/js/index.js
+++ b/public/js/index.js
@@ -1892,6 +1892,10 @@ $(document).ready(function () {
// Show exact time
$('.time-since').each(function () {
+ var time = new Date($(this).attr('title'))
+ if (!isNaN(time)){
+ $(this).attr('title', time.toLocaleString())
+ }
$(this).addClass('poping up').attr('data-content', $(this).attr('title')).attr('data-variation', 'inverted tiny').attr('title', '');
});