Skip to content

Commit f9448a1

Browse files
committed
refactor: . Rename dates to datesInPriorityOrder, to convey intent
1 parent e02a1e3 commit f9448a1

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/Task/Occurrence.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,24 +53,24 @@ export class Occurrence {
5353
* @private
5454
*/
5555
private getReferenceDate(): Moment | null {
56-
const dates: (Moment | null)[] = [];
56+
const datesInPriorityOrder: (Moment | null)[] = [];
5757

58-
dates.push(this.dueDate);
58+
datesInPriorityOrder.push(this.dueDate);
5959

6060
const { removeScheduledDateOnRecurrence } = getSettings();
6161
if (removeScheduledDateOnRecurrence) {
6262
// If the `removeScheduledDateOnRecurrence` setting is enabled, it does
6363
// not make sense to pick the scheduled date over the start date because
6464
// the scheduled date will be deleted in the newly created task. So if
6565
// this setting is enabled, we favour start date over scheduled date:
66-
dates.push(this.startDate);
67-
dates.push(this.scheduledDate);
66+
datesInPriorityOrder.push(this.startDate);
67+
datesInPriorityOrder.push(this.scheduledDate);
6868
} else {
69-
dates.push(this.scheduledDate);
70-
dates.push(this.startDate);
69+
datesInPriorityOrder.push(this.scheduledDate);
70+
datesInPriorityOrder.push(this.startDate);
7171
}
7272

73-
for (const date of dates) {
73+
for (const date of datesInPriorityOrder) {
7474
if (date) {
7575
return window.moment(date);
7676
}

0 commit comments

Comments
 (0)