Commits

Panayiotis Lipiridis committed 7af0b70

Date added to the chat messages

  • Participants
  • Parent commits fa8c0f7

Comments (0)

Files changed (1)

File main/static/src/coffee/site/chat.coffee

 
 window.on_chat_message_received = (message) ->
   time = new Date(message.time)
+  datestamp = "#{time.getFullYear()}-#{leading_zero(time.getMonth())}-#{leading_zero(time.getDate())}"
   timestamp = "#{leading_zero(time.getHours())}:#{leading_zero(time.getMinutes())}:#{leading_zero(time.getSeconds())}"
   $('.chat-log').prepend """
     <hr>
-    <h4>#{message.name} <small> @ #{timestamp}</small></h4>
+    <h4>#{message.name} <small>#{datestamp} @ #{timestamp}</small></h4>
     <h5>#{message.message}</h5>
   """