mirror of
https://github.com/samsonjs/samhuri.net.git
synced 2026-04-27 14:57:40 +00:00
display comment date & time in user's time zone
This commit is contained in:
parent
638e7797c6
commit
79710fa2c0
2 changed files with 3 additions and 2 deletions
|
|
@ -86,6 +86,7 @@
|
||||||
$('#sd').click(showComments)
|
$('#sd').click(showComments)
|
||||||
|
|
||||||
var showdown = new Showdown.converter()
|
var showdown = new Showdown.converter()
|
||||||
|
, tzOffset = -new Date().getTimezoneOffset() * 60 * 1000
|
||||||
|
|
||||||
$('#comment-form').submit(function() {
|
$('#comment-form').submit(function() {
|
||||||
var comment = $(this).serializeObject()
|
var comment = $(this).serializeObject()
|
||||||
|
|
@ -100,7 +101,7 @@
|
||||||
document.getElementById('thoughts').focus()
|
document.getElementById('thoughts').focus()
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
comment.timestamp = +comment.timestamp
|
comment.timestamp = +comment.timestamp + tzOffset
|
||||||
|
|
||||||
var options = { method: 'POST'
|
var options = { method: 'POST'
|
||||||
, uri: postCommentURL()
|
, uri: postCommentURL()
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,7 @@
|
||||||
<% } else { %>
|
<% } else { %>
|
||||||
<%= name %>
|
<%= name %>
|
||||||
<% } %>
|
<% } %>
|
||||||
@ <%= strftime('%F %r', new Date(timestamp)) %>
|
@ <%= strftime('%F %I:%M %p', new Date(timestamp)) %>
|
||||||
</p>
|
</p>
|
||||||
<blockquote><%= html %></blockquote>
|
<blockquote><%= html %></blockquote>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue