mirror of
https://github.com/urosran/cally.git
synced 2025-07-15 01:35:22 +00:00
- Changed number of weeks when creating recurring todo
This commit is contained in:
@ -18,7 +18,7 @@ export const getNextDailyDates = (date) => {
|
|||||||
const today = new Date();
|
const today = new Date();
|
||||||
const dates = [];
|
const dates = [];
|
||||||
|
|
||||||
for (let weekOffset = 0; weekOffset < 2; weekOffset++) {
|
for (let weekOffset = 0; weekOffset < 52; weekOffset++) {
|
||||||
const targetDate = addWeeks(date, weekOffset);
|
const targetDate = addWeeks(date, weekOffset);
|
||||||
if (targetDate > today) {
|
if (targetDate > today) {
|
||||||
dates.push(targetDate);
|
dates.push(targetDate);
|
||||||
@ -33,7 +33,7 @@ export const getNextWeeklyDates = (selectedDays, date) => {
|
|||||||
const currentDay = date.getDay();
|
const currentDay = date.getDay();
|
||||||
const dates = [];
|
const dates = [];
|
||||||
|
|
||||||
for (let week = 0; week < 2; week++) {
|
for (let week = 0; week < 52; week++) {
|
||||||
selectedDays.forEach((day) => {
|
selectedDays.forEach((day) => {
|
||||||
const targetDay = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'].indexOf(day);
|
const targetDay = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'].indexOf(day);
|
||||||
const diff = (targetDay - currentDay + 7) % 7 + week * 7; // Move to the next week
|
const diff = (targetDay - currentDay + 7) % 7 + week * 7; // Move to the next week
|
||||||
|
Reference in New Issue
Block a user