« get me outta code hell

hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/data
diff options
context:
space:
mode:
Diffstat (limited to 'src/data')
-rw-r--r--src/data/things/language.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/data/things/language.js b/src/data/things/language.js
index 631df94d..0354b6ac 100644
--- a/src/data/things/language.js
+++ b/src/data/things/language.js
@@ -99,6 +99,7 @@ export class Language extends Thing {
 
     intl_date: this.#intlHelper(Intl.DateTimeFormat, {full: true}),
     intl_dateYear: this.#intlHelper(Intl.DateTimeFormat, {year: 'numeric'}),
+    intl_dateMonthDay: this.#intlHelper(Intl.DateTimeFormat, {month: 'numeric', day: 'numeric'}),
     intl_number: this.#intlHelper(Intl.NumberFormat),
     intl_listConjunction: this.#intlHelper(Intl.ListFormat, {type: 'conjunction'}),
     intl_listDisjunction: this.#intlHelper(Intl.ListFormat, {type: 'disjunction'}),
@@ -463,6 +464,15 @@ export class Language extends Thing {
     return this.intl_dateYear.format(date);
   }
 
+  formatMonthDay(date) {
+    if (date === null || date === undefined) {
+      return html.blank();
+    }
+
+    this.assertIntlAvailable('intl_dateMonthDay');
+    return this.intl_dateMonthDay.format(date);
+  }
+
   formatYearRange(startDate, endDate) {
     // formatYearRange expects both values to be present, but if both are null
     // or both are undefined, that's just blank content.