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

Thanks to xet7 !
reviewable/pr4031/r1
Lauri Ojansivu 4 years ago
parent 94b67db78a
commit d06ac09485
  1. 1
      client/components/boards/boardBody.js
  2. 26
      client/components/cards/cardCustomFields.jade
  3. 4
      client/components/cards/cardCustomFields.js
  4. 12
      client/components/cards/cardDate.jade
  5. 4
      client/components/cards/cardDate.js
  6. 1
      client/lib/datepicker.js

@ -336,6 +336,7 @@ BlazeComponent.extendComponent({
defaultView: 'agendaDay',
editable: true,
timezone: 'local',
weekNumbers: true,
header: {
left: 'title today prev,next',
center:

@ -79,18 +79,22 @@ template(name="cardCustomField-currency")
template(name="cardCustomField-date")
if canModifyCard
a.js-edit-date(title="{{showTitle}}" class="{{classes}}")
if value
div.card-date
time(datetime="{{showISODate}}")
| {{showDate}}
else
| {{_ 'edit'}}
else
a.js-edit-date(title="{{showTitle}} {{_ 'predicate-week'}} {{showWeek}}" class="{{classes}}")
if value
div.card-date
time(datetime="{{showISODate}}")
| {{showDate}}
div.card-date
time(datetime="{{showISODate}}")
| {{showDate}}
b
| {{showWeek}}
else
| {{_ 'edit'}}
else
if value
div.card-date
time(datetime="{{showISODate}}")
| {{showDate}}
b
| {{showWeek}}
template(name="cardCustomField-dropdown")
if canModifyCard

@ -149,6 +149,10 @@ CardCustomField.register('cardCustomField');
});
}
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

@ -1,14 +1,20 @@
template(name="dateBadge")
if canModifyCard
a.js-edit-date.card-date(title="{{showTitle}}" class="{{classes}}")
a.js-edit-date.card-date(title="{{showTitle}} {{_ 'predicate-week'}} {{showWeek}}" class="{{classes}}")
time(datetime="{{showISODate}}")
| {{showDate}}
b
| {{showWeek}}
else
a.card-date(title="{{showTitle}}" class="{{classes}}")
a.card-date(title="{{showTitle}} {{_ 'predicate-week'}} {{showWeek}}" class="{{classes}}")
time(datetime="{{showISODate}}")
| {{showDate}}
b
| {{showWeek}}
template(name="dateCustomField")
a(title="{{showTitle}}" class="{{classes}}")
a(title="{{showTitle}} {{_ 'predicate-week'}} {{showWeek}}" class="{{classes}}")
time(datetime="{{showISODate}}")
| {{showDate}}
b
| {{showWeek}}

@ -115,6 +115,10 @@ const CardDate = BlazeComponent.extendComponent({
}, 60000);
},
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

@ -34,6 +34,7 @@ export class DatePicker extends BlazeComponent {
todayBtn: 'linked',
language: TAPi18n.getLanguage(),
weekStart: this.startDayOfWeek(),
calendarWeeks: true,
})
.on(
'changeDate',

Loading…
Cancel
Save