You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have been used this perfect tool a few days ago and noticed that there is a problem with the "genDayOfWeek" utils function.
In my local calendar, we are counting the week from Sunday to Saturday and unfortunately, when I use the function "genTimeBlock" that uses the "genDayOfWeek" function, it does not count from "Sunday" and the "Sunday" that in my local calendar is the beginning of the week, the function count "Sunday" like it's in the next week, and not as the beginning of the week.
The source of the problem is in this row:
return new Date(2019-07-${str2numberString[DayOfWeekString.toLowerCase()]}T00:00:00);
because it looks at a specific week in 2019, that is the 1st day of the month is on "Monday".
To solve it locally, I created my own function and changed the number of days to make it count the "Sunday" as the first day of the week.
My suggestion is to make this function more general by adding some "What is your first day of the week?"
I have been used this perfect tool a few days ago and noticed that there is a problem with the "genDayOfWeek" utils function.
In my local calendar, we are counting the week from Sunday to Saturday and unfortunately, when I use the function "genTimeBlock" that uses the "genDayOfWeek" function, it does not count from "Sunday" and the "Sunday" that in my local calendar is the beginning of the week, the function count "Sunday" like it's in the next week, and not as the beginning of the week.
The source of the problem is in this row:
return new Date(
2019-07-${str2numberString[DayOfWeekString.toLowerCase()]}T00:00:00);
because it looks at a specific week in 2019, that is the 1st day of the month is on "Monday".
To solve it locally, I created my own function and changed the number of days to make it count the "Sunday" as the first day of the week.
My suggestion is to make this function more general by adding some "What is your first day of the week?"
Code of the functions:
The text was updated successfully, but these errors were encountered: