I have a problem with function to split my time range into array of weeks. After run for example a time range: `10-08-2020` and `10-09-2020`, my last date is `13-09-2020` instead of `10-09-2020` :/

can someone tell me what is wrong with my function?

```
async getArrayOfWeeks(start: string, end: string) {
        const weeks = [];
        let current = new Date(start);
        const end = new Date(end);

        const increaseDays = (date: Date, amount: number) => new Date(date.setDate(date.getDate() + amount));

        while(current < end) {
            const beginOfWeek = new Date(current);
            let endOfWeek = increaseDays(current, 6);

            endOfWeek = endOfWeek > end ? end : endOfWeek;

            weeks.push({
                'week': beginOfWeek + " " + endOfWeek;
            });

            current = increaseDays(current, 1);
        }

        return weeks; 
    }

```

thanks for nay help :)