always use template strings instead of string concatenation

This commit is contained in:
zadam
2022-12-21 15:19:05 +01:00
parent ea006993f6
commit 1b24276a4a
154 changed files with 433 additions and 437 deletions

View File

@@ -78,7 +78,7 @@ export default class CalendarWidget extends RightDropdownButtonWidget {
init(activeDate) {
// attaching time fixes local timezone handling
this.activeDate = activeDate ? new Date(activeDate + "T12:00:00") : null;
this.activeDate = activeDate ? new Date(`${activeDate}T12:00:00`) : null;
this.todaysDate = new Date();
this.date = new Date((this.activeDate || this.todaysDate).getTime());
this.date.setDate(1);
@@ -97,7 +97,7 @@ export default class CalendarWidget extends RightDropdownButtonWidget {
if (day === 0) {
$newDay.css("marginLeft", (6 * 14.28) + '%');
} else {
$newDay.css("marginLeft", ((day - 1) * 14.28) + '%');
$newDay.css("marginLeft", `${(day - 1) * 14.28}%`);
}
}
@@ -132,7 +132,7 @@ export default class CalendarWidget extends RightDropdownButtonWidget {
async createMonth() {
const month = utils.formatDateISO(this.date).substr(0, 7);
const dateNotesForMonth = await server.get('special-notes/notes-for-month/' + month);
const dateNotesForMonth = await server.get(`special-notes/notes-for-month/${month}`);
this.$month.empty();
@@ -153,7 +153,7 @@ export default class CalendarWidget extends RightDropdownButtonWidget {
this.date.setDate(1);
this.date.setMonth(this.date.getMonth() - 1);
this.$label.html(this.monthsAsString(this.date.getMonth()) + ' ' + this.date.getFullYear());
this.$label.html(`${this.monthsAsString(this.date.getMonth())} ${this.date.getFullYear()}`);
}
monthsAsString(monthIndex) {