mirror of
https://github.com/go-shiori/shiori.git
synced 2025-12-09 05:25:53 +08:00
Show modified time in local time
This commit is contained in:
parent
e9d8f3ce12
commit
08f585b493
2 changed files with 18 additions and 7 deletions
File diff suppressed because one or more lines are too long
|
|
@ -472,10 +472,8 @@
|
|||
})
|
||||
},
|
||||
bookmarkTime: function (book) {
|
||||
var time = book.modified,
|
||||
readTime = "",
|
||||
finalBookmarkTime = "";
|
||||
|
||||
// Define read time
|
||||
var readTime = "";
|
||||
if (book.maxReadTime === 0) {
|
||||
readTime = "";
|
||||
} else if (book.minReadTime === book.maxReadTime) {
|
||||
|
|
@ -484,7 +482,20 @@
|
|||
readTime = book.minReadTime + "-" + book.maxReadTime + " min read";
|
||||
}
|
||||
|
||||
finalBookmarkTime = "Updated " + time;
|
||||
// Convert modified time to local
|
||||
var time = new Date(book.modified.replace(/-/g, '/') + ' +00');
|
||||
|
||||
// Create final time
|
||||
var month = ("00" + (time.getMonth() + 1)).slice(-2),
|
||||
date = ("00" + time.getDate()).slice(-2),
|
||||
hours = ("00" + time.getHours()).slice(-2),
|
||||
minutes = ("00" + time.getMinutes()).slice(-2),
|
||||
seconds = ("00" + time.getSeconds()).slice(-2);
|
||||
|
||||
var finalBookmarkTime = "Updated " +
|
||||
time.getFullYear() + "-" + month + "-" + date + " " +
|
||||
hours + ":" + minutes + ":" + seconds;
|
||||
|
||||
if (readTime !== "") finalBookmarkTime += " \u00B7 " + readTime;
|
||||
|
||||
return finalBookmarkTime;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue