mirror of
https://github.com/wekan/wekan.git
synced 2025-12-18 00:10:13 +01:00
Added week numbers to dates at card, minicard, Custom Field dates, DatePicker and Calendar.
Thanks to xet7 !
This commit is contained in:
parent
94b67db78a
commit
d06ac09485
6 changed files with 34 additions and 14 deletions
|
|
@ -336,6 +336,7 @@ BlazeComponent.extendComponent({
|
||||||
defaultView: 'agendaDay',
|
defaultView: 'agendaDay',
|
||||||
editable: true,
|
editable: true,
|
||||||
timezone: 'local',
|
timezone: 'local',
|
||||||
|
weekNumbers: true,
|
||||||
header: {
|
header: {
|
||||||
left: 'title today prev,next',
|
left: 'title today prev,next',
|
||||||
center:
|
center:
|
||||||
|
|
|
||||||
|
|
@ -79,18 +79,22 @@ template(name="cardCustomField-currency")
|
||||||
|
|
||||||
template(name="cardCustomField-date")
|
template(name="cardCustomField-date")
|
||||||
if canModifyCard
|
if canModifyCard
|
||||||
a.js-edit-date(title="{{showTitle}}" class="{{classes}}")
|
a.js-edit-date(title="{{showTitle}} {{_ 'predicate-week'}} {{showWeek}}" class="{{classes}}")
|
||||||
if value
|
|
||||||
div.card-date
|
|
||||||
time(datetime="{{showISODate}}")
|
|
||||||
| {{showDate}}
|
|
||||||
else
|
|
||||||
| {{_ 'edit'}}
|
|
||||||
else
|
|
||||||
if value
|
if value
|
||||||
div.card-date
|
div.card-date
|
||||||
time(datetime="{{showISODate}}")
|
time(datetime="{{showISODate}}")
|
||||||
| {{showDate}}
|
| {{showDate}}
|
||||||
|
b
|
||||||
|
| {{showWeek}}
|
||||||
|
else
|
||||||
|
| {{_ 'edit'}}
|
||||||
|
else
|
||||||
|
if value
|
||||||
|
div.card-date
|
||||||
|
time(datetime="{{showISODate}}")
|
||||||
|
| {{showDate}}
|
||||||
|
b
|
||||||
|
| {{showWeek}}
|
||||||
|
|
||||||
template(name="cardCustomField-dropdown")
|
template(name="cardCustomField-dropdown")
|
||||||
if canModifyCard
|
if canModifyCard
|
||||||
|
|
|
||||||
|
|
@ -149,6 +149,10 @@ CardCustomField.register('cardCustomField');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
showWeek() {
|
||||||
|
return this.date.get().week().toString();
|
||||||
|
}
|
||||||
|
|
||||||
showDate() {
|
showDate() {
|
||||||
// this will start working once mquandalle:moment
|
// this will start working once mquandalle:moment
|
||||||
// is updated to at least moment.js 2.10.5
|
// is updated to at least moment.js 2.10.5
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,20 @@
|
||||||
template(name="dateBadge")
|
template(name="dateBadge")
|
||||||
if canModifyCard
|
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}}")
|
time(datetime="{{showISODate}}")
|
||||||
| {{showDate}}
|
| {{showDate}}
|
||||||
|
b
|
||||||
|
| {{showWeek}}
|
||||||
else
|
else
|
||||||
a.card-date(title="{{showTitle}}" class="{{classes}}")
|
a.card-date(title="{{showTitle}} {{_ 'predicate-week'}} {{showWeek}}" class="{{classes}}")
|
||||||
time(datetime="{{showISODate}}")
|
time(datetime="{{showISODate}}")
|
||||||
| {{showDate}}
|
| {{showDate}}
|
||||||
|
b
|
||||||
|
| {{showWeek}}
|
||||||
|
|
||||||
template(name="dateCustomField")
|
template(name="dateCustomField")
|
||||||
a(title="{{showTitle}}" class="{{classes}}")
|
a(title="{{showTitle}} {{_ 'predicate-week'}} {{showWeek}}" class="{{classes}}")
|
||||||
time(datetime="{{showISODate}}")
|
time(datetime="{{showISODate}}")
|
||||||
| {{showDate}}
|
| {{showDate}}
|
||||||
|
b
|
||||||
|
| {{showWeek}}
|
||||||
|
|
|
||||||
|
|
@ -115,6 +115,10 @@ const CardDate = BlazeComponent.extendComponent({
|
||||||
}, 60000);
|
}, 60000);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
showWeek() {
|
||||||
|
return this.date.get().week().toString();
|
||||||
|
},
|
||||||
|
|
||||||
showDate() {
|
showDate() {
|
||||||
// this will start working once mquandalle:moment
|
// this will start working once mquandalle:moment
|
||||||
// is updated to at least moment.js 2.10.5
|
// is updated to at least moment.js 2.10.5
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,7 @@ export class DatePicker extends BlazeComponent {
|
||||||
todayBtn: 'linked',
|
todayBtn: 'linked',
|
||||||
language: TAPi18n.getLanguage(),
|
language: TAPi18n.getLanguage(),
|
||||||
weekStart: this.startDayOfWeek(),
|
weekStart: this.startDayOfWeek(),
|
||||||
|
calendarWeeks: true,
|
||||||
})
|
})
|
||||||
.on(
|
.on(
|
||||||
'changeDate',
|
'changeDate',
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue