« get me outta code hell

hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/content/dependencies/generateAbsoluteDatetimestamp.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/content/dependencies/generateAbsoluteDatetimestamp.js')
-rw-r--r--src/content/dependencies/generateAbsoluteDatetimestamp.js22
1 files changed, 17 insertions, 5 deletions
diff --git a/src/content/dependencies/generateAbsoluteDatetimestamp.js b/src/content/dependencies/generateAbsoluteDatetimestamp.js
index 63acecf2..930b6f13 100644
--- a/src/content/dependencies/generateAbsoluteDatetimestamp.js
+++ b/src/content/dependencies/generateAbsoluteDatetimestamp.js
@@ -1,12 +1,21 @@
 export default {
-  contentDependencies: ['generateDatetimestampTemplate'],
+  contentDependencies: [
+    'generateDatetimestampTemplate',
+    'generateTooltip',
+  ],
+
   extraDependencies: ['html', 'language'],
 
   data: (date) =>
     ({date}),
 
-  relations: (relation) =>
-    ({template: relation('generateDatetimestampTemplate')}),
+  relations: (relation) => ({
+    template:
+      relation('generateDatetimestampTemplate'),
+
+    tooltip:
+      relation('generateTooltip'),
+  }),
 
   slots: {
     style: {
@@ -30,10 +39,13 @@ export default {
           ? data.date.getFullYear().toString()
           : null),
 
-      tooltipContent:
+      tooltip:
         slots.tooltip &&
         slots.style === 'year' &&
-          language.formatDate(data.date),
+          relations.tooltip.slots({
+            content:
+              language.formatDate(data.date),
+          }),
 
       datetime:
         data.date.toISOString(),