Sha256: 1f6770f0f61ec654083ed16b2a4c111129a40fc2340d7f8e5db626f0bc90e3d0

Contents?: true

Size: 593 Bytes

Versions: 35

Compression:

Stored size: 593 Bytes

Contents

require 'time'

module TumblogHelper

  DAYS = {}
  (1..31).each {|day| DAYS[day] = "%dth" % day}
  DAYS[1]  = "1st"
  DAYS[2]  = "2nd"
  DAYS[3]  = "3rd"
  DAYS[21] = "21st"
  DAYS[22] = "22nd"
  DAYS[23] = "23rd"
  DAYS[31] = "31st"

  def tumblog_date( time )
    <<-HTML
    <div class="date">
      <div class="date_brick">
        #{Time::RFC2822_MONTH_NAME.at(time.month-1)}<br />
        #{TumblogHelper::DAYS[time.day]}
      </div>
        #{Time::RFC2822_DAY_NAME.at(time.wday)}
    </div>
    HTML
  end

end  # module TumblogHelper

Webby::Helpers.register(TumblogHelper)

# EOF

Version data entries

35 entries across 20 versions & 9 rubygems

Version Path
Shazburg-webby-0.9.0 examples/tumblog/lib/tumblog_helper.rb
TwP-webby-0.9.0 examples/tumblog/lib/tumblog_helper.rb
TwP-webby-0.9.1 examples/tumblog/lib/tumblog_helper.rb
TwP-webby-0.9.1 spec/data/lib/tumblog_helper.rb
TwP-webby-0.9.2 spec/data/lib/tumblog_helper.rb
TwP-webby-0.9.2 examples/tumblog/lib/tumblog_helper.rb
TwP-webby-0.9.3 spec/data/site/lib/tumblog_helper.rb
TwP-webby-0.9.3 examples/tumblog/lib/tumblog_helper.rb
TwP-webby-0.9.4.1 examples/tumblog/lib/tumblog_helper.rb
TwP-webby-0.9.4.1 spec/data/site/lib/tumblog_helper.rb
TwP-webby-0.9.4 spec/data/site/lib/tumblog_helper.rb
TwP-webby-0.9.4 examples/tumblog/lib/tumblog_helper.rb
blowmage-webby-0.9.4.1 spec/data/site/lib/tumblog_helper.rb
blowmage-webby-0.9.4.1 examples/tumblog/lib/tumblog_helper.rb
dysinger-webby-0.9.4 spec/data/site/lib/tumblog_helper.rb
dysinger-webby-0.9.4 examples/tumblog/lib/tumblog_helper.rb
francois-webby-0.9.4.1 examples/tumblog/lib/tumblog_helper.rb
francois-webby-0.9.4.1 spec/data/site/lib/tumblog_helper.rb
giraffesoft-webby-0.9.5 spec/data/site/lib/tumblog_helper.rb
giraffesoft-webby-0.9.5 examples/tumblog/lib/tumblog_helper.rb