mirror of
https://github.com/zadam/trilium.git
synced 2025-11-07 13:56:11 +01:00
always use template strings instead of string concatenation
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user