-
Notifications
You must be signed in to change notification settings - Fork 0
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
1280: Simplified planning form. Added default value #112
Conversation
Clean up UI for planning
const { x } = scrollToColumn.getBoundingClientRect(); | ||
const { x: firstColumnX } = firstColumn.getBoundingClientRect(); |
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.
It took me a while to actually understand what's going on here.
const { x } = scrollToColumn.getBoundingClientRect(); | |
const { x: firstColumnX } = firstColumn.getBoundingClientRect(); | |
const x = scrollToColumn.getBoundingClientRect().x; | |
const firstColumnX = firstColumn.getBoundingClientRect().x; |
is much easier to understand.
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.
Changed it. Thanks for the suggestion.
@@ -378,6 +377,7 @@ public function getPlanningDataWeeks(): PlanningData | |||
$weeks = $planning->weeks; | |||
|
|||
$currentYear = (int) (new \DateTime())->format('Y'); | |||
$currentWeek = (int) (new \DateTime())->format('W'); | |||
|
|||
for ($weekNumber = 1; $weekNumber <= 52; ++$weekNumber) { |
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.
A year can actually have 53 weeks (cf. https://en.wikipedia.org/wiki/ISO_week_date#Weeks_per_year), and the year 2026 (in the near future is one of them), so this should be rewritten to iterate over all weeks in the year (or use https://stackoverflow.com/a/21480444).
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.
I can't take credit for this. So, I have pasted your suggestion into a comment.
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.
Approved with a couple of comments.
Link to ticket
https://leantime.itkdev.dk/#/tickets/showTicket/1280
Description
Simplified planning form. Added default value.
Checklist