summaryrefslogtreecommitdiff
path: root/lib/render
diff options
context:
space:
mode:
Diffstat (limited to 'lib/render')
-rw-r--r--lib/render/view.ml14
1 files changed, 13 insertions, 1 deletions
diff --git a/lib/render/view.ml b/lib/render/view.ml
index 0691ffb..67dfa70 100644
--- a/lib/render/view.ml
+++ b/lib/render/view.ml
@@ -267,8 +267,20 @@ let of_days ~lang ~sigla ~vocab ~rite ~year days =
let month_name = Lang.month lang m in
let month_abbr = Lang.month_abbr lang m in
T.Obj
- [ ("num", str month_num);
+ [ (* A month carries its own name under BOTH spellings. The week
+ objects nested below expose [month_name]/[month_num]/
+ [month_abbr], and a template author who learned those names
+ there naturally reaches for them one level up -- where, before
+ this, they resolved to nothing and rendered as the empty
+ string, because an unknown key is silently empty by design.
+ A month is the only scope where the short forms are
+ unambiguous, so they stay as the primary names and the
+ qualified forms are aliases. *)
+ ("num", str month_num);
("name", str month_name);
+ ("month_num", str month_num);
+ ("month_name", str month_name);
+ ("month_abbr", str month_abbr);
("days", T.List day_values);
("weeks", T.List (weeks_of_month ~first_dow ~month_num ~month_name ~month_abbr day_values)) ])
in