<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -61,6 +61,18 @@ end#Chat
 
 # -----------------------------------------------------------------------------
 
+# == Helpers
+
+helpers do
+  
+  def human_date(t)
+    Time.at(t).strftime('%m/%d').gsub(/0(\d)/, '\1') +
+    '&amp;nbsp;' + 
+    Time.at(t).strftime('%H:%m')
+  end
+  
+end
+
 
 # == 'Routing' &amp; 'Controllers' of the application
 
@@ -76,7 +88,7 @@ end
 get '/listen' do
   out = &quot;&quot;
   Chat.listen(params[:from]).each do |m| 
-    out &lt;&lt; &quot;&lt;p id=\&quot;#{m[:created_at]}\&quot;&gt;&lt;strong&gt;#{m[:author]}&lt;/strong&gt; &lt;em&gt;says&lt;/em&gt; &lt;span&gt;#{m[:message]}&lt;/span&gt;&lt;/p&gt;&quot;
+    out &lt;&lt; &quot;&lt;p id=\&quot;#{m[:created_at]}\&quot;&gt;&lt;strong&gt;#{m[:author]}&lt;/strong&gt; &lt;em&gt;says&lt;/em&gt; &lt;span&gt;#{m[:message]}&lt;/span&gt;&lt;span class='d'&gt; @ #{human_date(m[:created_at])}&lt;/span&gt;&lt;/p&gt;&quot;
   end
   out
 end</diff>
      <filename>chat.rb</filename>
    </modified>
    <modified>
      <diff>@@ -6,6 +6,7 @@ h2 { text-transform: uppercase; }
 #chat p strong { color: #999; }
 #chat p em { color: #ccc; }
 #chat p span { font-size: 140%; }
+#chat p span.d { color: #ccc; font-size: 75%; }
 
 .info { font-size: 85%; color: #999; }
 </diff>
      <filename>public/style.css</filename>
    </modified>
    <modified>
      <diff>@@ -22,7 +22,7 @@
     &lt;p id=&quot;chat_message&quot;&gt;&lt;em&gt;Welcome to the chat...&lt;/em&gt;&lt;/p&gt;
     &lt;%# Lets display all messages we have.... %&gt;
     &lt;% @messages.each do |m| %&gt;
-    &lt;p id=&quot;&lt;%= m[:created_at] %&gt;&quot;&gt;&lt;strong&gt;&lt;%= m[:author] %&gt;&lt;/strong&gt; &lt;em&gt;says&lt;/em&gt; &lt;span&gt;&lt;%= m[:message] %&gt;&lt;/span&gt;&lt;/p&gt;
+    &lt;p id=&quot;&lt;%= m[:created_at] %&gt;&quot;&gt;&lt;strong&gt;&lt;%= m[:author] %&gt;&lt;/strong&gt; &lt;em&gt;says&lt;/em&gt; &lt;span&gt;&lt;%= m[:message] %&gt;&lt;/span&gt;&lt;span class='d'&gt; @ &lt;%= human_date(m[:created_at]) %&gt;&lt;/span&gt;&lt;/p&gt;
     &lt;% end %&gt;
   &lt;/div&gt;
 &lt;/div&gt;</diff>
      <filename>views/index.erb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>edbd922fe71a9fdc1274cefa477a3250382eb73c</id>
    </parent>
  </parents>
  <author>
    <name>Karel Minarik</name>
    <email>karmi@karmi.cz</email>
  </author>
  <url>http://github.com/karmi/yaml_micro_chat/commit/9eba15fd8680fd946a9981a5d180c04584ff0f8d</url>
  <id>9eba15fd8680fd946a9981a5d180c04584ff0f8d</id>
  <committed-date>2008-07-01T05:01:59-07:00</committed-date>
  <authored-date>2008-07-01T05:00:46-07:00</authored-date>
  <message>Added helper for formatting date of posting message to chat; Added when message was posted into listing</message>
  <tree>37f2e6940252aceb02c78acc04ae1d409e5729b0</tree>
  <committer>
    <name>Karel Minarik</name>
    <email>karmi@karmi.cz</email>
  </committer>
</commit>
