浏览代码

Added week numbers to dates at card, minicard, Custom Field dates, DatePicker and Calendar. Part 2.

Thanks to xet7 !
Lauri Ojansivu 3 年之前
父节点
当前提交
9e6744d1e3
共有 1 个文件被更改,包括 16 次插入3 次删除
  1. 16 3
      client/components/cards/cardDate.js

+ 16 - 3
client/components/cards/cardDate.js

@@ -288,12 +288,25 @@ class CardCustomFieldDate extends CardDate {
     });
     });
   }
   }
 
 
-  classes() {
-    return 'customfield-date';
+  showWeek() {
+    return this.date.get().week().toString();
+  }
+
+  showDate() {
+    // this will start working once mquandalle:moment
+    // is updated to at least moment.js 2.10.5
+    // until then, the date is displayed in the "L" format
+    return this.date.get().calendar(null, {
+      sameElse: 'llll',
+    });
   }
   }
 
 
   showTitle() {
   showTitle() {
-    return '';
+    return `${this.date.get().format('LLLL')}`;
+  }
+
+  classes() {
+    return 'customfield-date';
   }
   }
 
 
   events() {
   events() {