Skip to content
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

#2554 fix and refactor date tooltip getMonthHTML #2555

Merged
merged 1 commit into from
Sep 4, 2024

Conversation

dv1x3r
Copy link
Contributor

@dv1x3r dv1x3r commented Aug 30, 2024

I did a brief refactoring for getMonthHTML function. fixes #2554

  1. The bug was located between w2tooltip.js lines 2760 and 2770
  2. If weekDay = 0 (Sunday), no offset was applied for Monday-first calendars
  3. The else block at line 2765 does not make sense for me
  4. I also changed some variable names to prevent confusion:
  • Now we operate with only one DT object, keeping all original transformations
  • weekDays -> weekDaysHeaderHTML
  • weekDay and weekday -> weekDayOffset

(PR does not include recompiled files)

@@ -2711,31 +2711,32 @@ class DateTooltip extends Tooltip {
sdays.unshift(sdays.pop())
}

let td = new Date()
let DT = new Date()
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

td stands for today

@vitmalina vitmalina merged commit e8f7efd into vitmalina:master Sep 4, 2024
@dv1x3r dv1x3r deleted the fix/calendar branch September 4, 2024 15:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Weekdays displayed incorrectly in the date picker widget
2 participants