From 8473add34098228f67ae33cd90e905fc83e2c5e6 Mon Sep 17 00:00:00 2001 From: Benjamin Kellermann Date: Tue, 1 Jun 2010 09:13:06 +0200 Subject: bugfix: wrong locale caused exception --- timepollhead.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'timepollhead.rb') diff --git a/timepollhead.rb b/timepollhead.rb index 14f2339..56a85db 100644 --- a/timepollhead.rb +++ b/timepollhead.rb @@ -120,7 +120,7 @@ class TimePollHead ret = "" head_count("%Y-%m",false).each{|title,count| year, month = title.split("-").collect{|e| e.to_i} - ret += "#{Date::DATE_TEXTS[Date_locale.get_language_key(Locale.current)][:abbr_monthnames][month]} #{year}\n" + ret += "#{Date.parse("#{year}-#{month}-01").strftime("%b %Y")}\n" } ret += "" -- cgit v1.2.3 From 966ce4209f6a5ed13cf898a01998fbef8fdb5db4 Mon Sep 17 00:00:00 2001 From: Benjamin Kellermann Date: Tue, 1 Jun 2010 09:59:10 +0200 Subject: additional bugfix for locale problem --- timepollhead.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'timepollhead.rb') diff --git a/timepollhead.rb b/timepollhead.rb index 56a85db..dc4476c 100644 --- a/timepollhead.rb +++ b/timepollhead.rb @@ -253,7 +253,10 @@ END ret += "\n" - 7.times{|i| ret += "#{Date::DATE_TEXTS[Date_locale.get_language_key(Locale.current)][:abbr_daynames][(i+1)%7]}" } + 7.times{|i| + # 2010-03-01 was a Monday, so we can use this month for a dirty hack + ret += "#{Date.parse("2010-03-0#{i+1}").strftime("%a")}" + } ret += "\n" ((@startdate.wday+7-1)%7).times{ @@ -298,7 +301,7 @@ END ret += "" head_count("%Y-%m",true).each{|title,count| year,month = title.split("-").collect{|e| e.to_i} - ret += "#{Date::DATE_TEXTS[Date_locale.get_language_key(Locale.current)][:abbr_monthnames][month]} #{year}\n" + ret += "#{Date.parse("#{year}-#{month}-01").strftime("%b %Y")}\n" } ret += "" + _("Time") + "" -- cgit v1.2.3