-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: updated calcualtions for showSixWeeks #2562
base: master
Are you sure you want to change the base?
Conversation
let before: XDate[] = []; | ||
let after: XDate[] = []; | ||
const days = dates.map(day => day.clone()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added this to insure immutability, I'm not sure if this is indeed needed tho
|
||
if (showSixWeeks && !daysForSixWeeks) { | ||
if (42 - daysOnPage > 7) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for months with 28 days (5 weeks) (Feb 2026) => add 7 days before
Otherwise there's situation where 2 weeks from next month are displayed at the end and it just doesnt look right
If it bothers you we can just do to.addDays(42 - daysOnPage) but it's uglier in my opinion
|
||
if (showSixWeeks && !daysForSixWeeks) { | ||
if (42 - daysOnPage > 7) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
42 = 6weeks * 7days
Should I move it to variable or you can understand from the context what it is ?
@Inbal-Tish Hi, could you please take a look at this PR (: |
This PR fixes: