From caa0a9f01c4f3a8ca85a0ce4e335c71235006432 Mon Sep 17 00:00:00 2001 From: Carlos Goce Date: Fri, 23 Jan 2015 18:49:44 +0100 Subject: Add a pending test. Day names are not localized --- lib/carlosgoce/calendar.rb | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'lib') diff --git a/lib/carlosgoce/calendar.rb b/lib/carlosgoce/calendar.rb index e06b61b..d51df90 100644 --- a/lib/carlosgoce/calendar.rb +++ b/lib/carlosgoce/calendar.rb @@ -16,6 +16,15 @@ module CarlosGoce h[month] = Hash.new.tap {|m| m[:days] = (1..Time.days_in_month(month, @year)).to_a m[:name] = I18n.t('date.month_names')[month].downcase + + # todo: Need improvement. Not too performant... + # todo: Maby it should be moved to it's own class too to keep things simple + m[:days_names] = Array.new.tap {|a| + m[:days].each do |d| + t = Time.new @year, month, d + a << t.strftime('%A').downcase + end + } } end } -- cgit v1.2.3