Skip to content

Commit

Permalink
Merge tag 'x' into fix/calendar_out_of_range
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Tsang committed Nov 23, 2023
2 parents 20775f2 + d4ed3b6 commit 3fa004f
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions src/gtfs/native/ScheduleCalendar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export class ScheduleCalendar {
}

/**
* Remove the given days from the calendar then tighten the dates
* Remove the given days from the calendar
*/
public clone(start: Moment,
end: Moment,
Expand All @@ -111,16 +111,6 @@ export class ScheduleCalendar {

const days = this.removeDays(removeDays);

// skip forward to the first day the schedule is operating
while (days[start.day()] === 0 || excludeDays[start.format("YYYYMMDD")] && start.isSameOrBefore(end)) {
start.add(1, "days");
}

// skip backward to the first day the schedule is operating
while (days[end.day()] === 0 || excludeDays[end.format("YYYYMMDD")] && end.isSameOrAfter(start)) {
end.subtract(1, "days");
}

const newExcludes = Object
.values(excludeDays)
.filter(d => d.isBetween(start, end, "days", "[]"))
Expand Down

0 comments on commit 3fa004f

Please sign in to comment.