diff options
-rw-r--r-- | date_locale.rb | 7 | ||||
-rw-r--r-- | timepollhead.rb | 9 |
2 files changed, 12 insertions, 4 deletions
diff --git a/date_locale.rb b/date_locale.rb index 4ab9b4d..e40e6c7 100644 --- a/date_locale.rb +++ b/date_locale.rb @@ -217,7 +217,12 @@ module Date_locale monthnames = DATE_TEXTS[lang][:monthnames]
abbr_monthnames = DATE_TEXTS[lang][:abbr_monthnames]
else
- raise "Missing Support for locale #{lang.inspect}"
+ #raise "Missing Support for locale #{lang.inspect}"
+ #fallback to english
+ daynames = DATE_TEXTS[:en][:daynames]
+ abbr_daynames = DATE_TEXTS[:en][:abbr_daynames]
+ monthnames = DATE_TEXTS[:en][:monthnames]
+ abbr_monthnames = DATE_TEXTS[:en][:abbr_monthnames]
end
#Make the original replacements, after....
diff --git a/timepollhead.rb b/timepollhead.rb index 45f826d..6f3fcec 100644 --- a/timepollhead.rb +++ b/timepollhead.rb @@ -120,7 +120,7 @@ class TimePollHead ret = "<tr><th colspan='2' class='invisible'></th>" head_count("%Y-%m",false).each{|title,count| year, month = title.split("-").collect{|e| e.to_i} - ret += "<th colspan='#{count}'>#{Date::DATE_TEXTS[Date_locale.get_language_key(Locale.current)][:abbr_monthnames][month]} #{year}</th>\n" + ret += "<th colspan='#{count}'>#{Date.parse("#{year}-#{month}-01").strftime("%b %Y")}</th>\n" } ret += "<th class='invisible'></th></tr><tr><th colspan='2' class='invisible'></th>" @@ -254,7 +254,10 @@ END ret += "</tr><tr>\n" - 7.times{|i| ret += "<th class='weekday'>#{Date::DATE_TEXTS[Date_locale.get_language_key(Locale.current)][:abbr_daynames][(i+1)%7]}</th>" } + 7.times{|i| + # 2010-03-01 was a Monday, so we can use this month for a dirty hack + ret += "<th class='weekday'>#{Date.parse("2010-03-0#{i+1}").strftime("%a")}</th>" + } ret += "</tr><tr>\n" ((@startdate.wday+7-1)%7).times{ @@ -299,7 +302,7 @@ END ret += "<th class='invisible'></th>" head_count("%Y-%m",true).each{|title,count| year,month = title.split("-").collect{|e| e.to_i} - ret += "<th colspan='#{count}'>#{Date::DATE_TEXTS[Date_locale.get_language_key(Locale.current)][:abbr_monthnames][month]} #{year}</th>\n" + ret += "<th colspan='#{count}'>#{Date.parse("#{year}-#{month}-01").strftime("%b %Y")}</th>\n" } ret += "</tr><tr><th>" + _("Time") + "</th>" |