diff options
author | NateScarlet <NateScarlet@Gmail.com> | 2019-03-20 09:27:49 +0800 |
---|---|---|
committer | Lunny Xiao <xiaolunwen@gmail.com> | 2019-03-20 09:27:49 +0800 |
commit | b78cbbcaa25d03d07b77a010a26568182682c6f1 (patch) | |
tree | 8e1f487a8b6895f5d8870cf67135471259636beb | |
parent | f125330fcf89550e380057d69dae61871b5b0c8b (diff) | |
download | gitea-b78cbbcaa25d03d07b77a010a26568182682c6f1.tar.gz gitea-b78cbbcaa25d03d07b77a010a26568182682c6f1.zip |
Show locale string on timestamp (#6324)
Resolve #6004
-rw-r--r-- | public/js/index.js | 4 |
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', ''); }); |