No hour on short and Hour on comments
So reverted modif from date-short Added new date-comments to have hours on them (when screen is big enough) Edited the view for displaying date comments, they were displayed on the border (even with old date-short)
Cette révision appartient à :
Parent
d7071767f9
révision
64d073f03c
2 fichiers modifiés avec 21 ajouts et 18 suppressions
|
@ -18,7 +18,7 @@ function toggleLayer(elem) {
|
|||
|
||||
// Date formatting
|
||||
var lang = $("html").attr("lang");
|
||||
var shortOpt = { year: "numeric", month: "short", day: "numeric", hour:"numeric", minute:"numeric" };
|
||||
var shortOpt = { year: "numeric", month: "short", day: "numeric" };
|
||||
|
||||
var list = document.getElementsByClassName("date-short");
|
||||
for(var i in list) {
|
||||
|
@ -34,6 +34,13 @@ for(var i in list) {
|
|||
e.innerText = new Date(e.innerText).toLocaleString(lang);
|
||||
}
|
||||
|
||||
var list = document.getElementsByClassName("date-comments");
|
||||
for(var i in list) {
|
||||
var e = list[i];
|
||||
e.title = e.innerText;
|
||||
e.innerText = new Date(e.title).toLocaleDateString(lang, { year: "numeric", month: "short", day: "numeric"}) + " ";
|
||||
$(e).append($('<span class="hidden-xs"></span>').text(new Date(e.title).toLocaleTimeString(lang, { hour:"numeric", minute:"numeric" })))
|
||||
}
|
||||
/*Fixed-Navbar offset fix*/
|
||||
window.onload = function() {
|
||||
var shiftWindow = function() { scrollBy(0, -70) };
|
||||
|
|
|
@ -131,23 +131,19 @@
|
|||
<div class="commentData">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="row">
|
||||
<div class="col-sm-9">
|
||||
{{if eq .UserID -1}}
|
||||
<a href="#comment_{{inc $index}}">#{{inc $index}}</a> by {{.Username}}
|
||||
{{else}}
|
||||
<a href="#comment_{{inc $index}}">#{{inc $index}}</a>
|
||||
by <span class="break"><a href="{{$.URL.Parse (printf "/user/%d/-" .UserID ) }}">{{.Username}}</a></span>
|
||||
{{end}}
|
||||
</div>
|
||||
<div class="col-sm-3">
|
||||
<i class="pull-right date-short comment-date">
|
||||
<small>
|
||||
{{ formatDateRFC .Date }}
|
||||
{{/* JS will format the date as always */}}
|
||||
</small>
|
||||
</i>
|
||||
</div>
|
||||
<i class="pull-right date-comments comment-date">
|
||||
<small>
|
||||
{{ formatDateRFC .Date }}
|
||||
{{/* JS will format the date as always */}}
|
||||
</small>
|
||||
</i>
|
||||
<div>
|
||||
{{if eq .UserID -1}}
|
||||
<a href="#comment_{{inc $index}}">#{{inc $index}}</a> by {{.Username}}
|
||||
{{else}}
|
||||
<a href="#comment_{{inc $index}}">#{{inc $index}}</a>
|
||||
by <span class="break"><a href="{{$.URL.Parse (printf "/user/%d/-" .UserID ) }}">{{.Username}}</a></span>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
Référencer dans un nouveau ticket