mirror of
https://github.com/samsonjs/samhuri.net.git
synced 2026-04-08 11:05:54 +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)
|
||||
|
||||
var showdown = new Showdown.converter()
|
||||
, tzOffset = -new Date().getTimezoneOffset() * 60 * 1000
|
||||
|
||||
$('#comment-form').submit(function() {
|
||||
var comment = $(this).serializeObject()
|
||||
|
|
@ -100,7 +101,7 @@
|
|||
document.getElementById('thoughts').focus()
|
||||
return false
|
||||
}
|
||||
comment.timestamp = +comment.timestamp
|
||||
comment.timestamp = +comment.timestamp + tzOffset
|
||||
|
||||
var options = { method: 'POST'
|
||||
, uri: postCommentURL()
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@
|
|||
<% } else { %>
|
||||
<%= name %>
|
||||
<% } %>
|
||||
@ <%= strftime('%F %r', new Date(timestamp)) %>
|
||||
@ <%= strftime('%F %I:%M %p', new Date(timestamp)) %>
|
||||
</p>
|
||||
<blockquote><%= html %></blockquote>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Reference in a new issue