« get me outta code hell

data: Contribution.date (stub) - 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:
author(quasar) nebula <qznebula@protonmail.com>2024-03-07 12:13:13 -0400
committer(quasar) nebula <qznebula@protonmail.com>2024-06-12 17:26:40 -0300
commit72f5aafcbb4de53eadef3cd7603856b37ac9cc49 (patch)
tree04352f336ad511cc3c00f6b8f2d1ce13038bdaf7 /src/data
parentcd2767972a0f10504b3a731d736a13f6e53139c0 (diff)
data: Contribution.date (stub)
Diffstat (limited to 'src/data')
-rw-r--r--src/data/things/contribution.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/data/things/contribution.js b/src/data/things/contribution.js
index 5594055c..cfece5dc 100644
--- a/src/data/things/contribution.js
+++ b/src/data/things/contribution.js
@@ -9,7 +9,7 @@ import {isStringNonEmpty, isThing, validateReference} from '#validators';
 
 import {exposeDependency} from '#composite/control-flow';
 import {withResolvedReference} from '#composite/wiki-data';
-import {flag} from '#composite/wiki-properties';
+import {flag, simpleDate} from '#composite/wiki-properties';
 
 import {
   inheritFromContributionPresets,
@@ -32,6 +32,8 @@ export class Contribution extends Thing {
       update: {validate: isStringNonEmpty},
     },
 
+    date: simpleDate(),
+
     artist: [
       withContributionArtist({
         ref: input.updateValue({
@@ -105,6 +107,10 @@ export class Contribution extends Thing {
       accentParts.push(colors.green(`"${this.annotation}"`));
     }
 
+    if (this.date) {
+      accentParts.push(colors.yellow(this.date.toLocaleDateString()));
+    }
+
     let artistRef;
     if (depth >= 0) {
       let artist;