Show localtime instead of UTC

This commit is contained in:
Radhi Fadlillah 2019-08-06 23:37:52 +07:00
parent c8c29fe933
commit f79eb5c1dd
6 changed files with 34 additions and 14 deletions

View file

@ -18,13 +18,14 @@
<link href="/css/custom-dialog.css" rel="stylesheet">
<link href="/css/bookmark-item.css" rel="stylesheet">
<script src="/js/dayjs.min.js"></script>
<script src="/js/vue.min.js"></script>
</head>
<body class="night">
<div id="content-scene" :class="{night: displayOptions.nightMode}">
<div id="header">
<p id="metadata">Added $$.Modified$$ UTC</p>
<p id="metadata" v-cloak>Added {{localtime()}}</p>
<p id="title">$$.Title$$</p>
<div id="links">
<a href="$$.URL$$" target="_blank" rel="noopener">View Original</a>
@ -45,7 +46,14 @@
new Vue({
el: '#content-scene',
mixins: [basePage],
data: {
modified: "$$.Modified$$"
},
methods: {
localtime() {
var strTime = `${this.modified.replace(" ", "T")}+00:00`;
return dayjs(strTime).format("D MMMM YYYY, HH:mm:ss");
},
loadSetting() {
var opts = JSON.parse(localStorage.getItem("shiori-setting")) || {},
showId = (typeof opts.showId === "boolean") ? opts.showId : false,

File diff suppressed because one or more lines are too long

1
internal/view/js/dayjs.min.js vendored Normal file

File diff suppressed because one or more lines are too long

View file

@ -408,6 +408,10 @@ a {
text-align: center;
font-size: 16px;
color: var(--colorLink);
&[v-cloak] {
visibility: hidden;
}
}
#title {

File diff suppressed because one or more lines are too long

View file

@ -35,9 +35,8 @@ func (h *handler) serveJsFile(w http.ResponseWriter, r *http.Request, ps httprou
filePath = path.Join(fileDir, fileName)
if assetExists(filePath) {
redirectPage(w, r, filePath)
return
}
return
}
err := serveFile(w, r.URL.Path, true)