Skip to content

Conversation

@hazemayman1
Copy link

Changed the {day} dropdown to adapt to the selected month. It was previously set to 31 for all months which allowed the user to select the 31st on a 28 or 30 day month for example.

task-5392293

@robodoo
Copy link

robodoo commented Dec 5, 2025

This PR targets the un-managed branch odoo-dev/odoo:master-hr-onboarding-haabo, it needs to be retargeted before it can be merged.

@hazemayman1 hazemayman1 force-pushed the master-hr-onboarding-ux_accrual-haabo branch from 4329ea4 to 3207f98 Compare December 10, 2025 09:07
Changed the {day} dropdown to adapt to the selected month. It was previously set to 31 for all months which allowed the user to select the 31st on a 28 or 30 day month for example.

task-5392293
@hazemayman1 hazemayman1 force-pushed the master-hr-onboarding-ux_accrual-haabo branch from 3207f98 to d7d62df Compare December 10, 2025 09:13
Copy link

@Mahmoudk3m Mahmoudk3m left a comment

Choose a reason for hiding this comment

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

Thanks for your work 🚀
Just a few comments.

Comment on lines +13 to +14
let date = new Date(2024, selectedMonth, 0);
let days = date.getDate();

Choose a reason for hiding this comment

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

Suggested change
let date = new Date(2024, selectedMonth, 0);
let days = date.getDate();
const date = new Date(2024, selectedMonth, 0);
const days = date.getDate();

Use const instead of let where values don't change:

const selectedMonth = this.props.record.data[this.props.selectedMonth];
let date = new Date(2024, selectedMonth, 0);
let days = date.getDate();
let newChoicesList = Array.from({length: days}, (_, i) => [(i + 1).toString(),(i + 1).toString()])

Choose a reason for hiding this comment

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

Suggested change
let newChoicesList = Array.from({length: days}, (_, i) => [(i + 1).toString(),(i + 1).toString()])
let newChoicesList = Array.from({length: days}, (_, i) => [(i + 1).toString(), (i + 1).toString()])

missing space after comma


get options() {
const selectedMonth = this.props.record.data[this.props.selectedMonth];
let date = new Date(2024, selectedMonth, 0);

Choose a reason for hiding this comment

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

I would add a comment to explain why I used 2024 specifically, because it might be a bit confusing.



get options() {
const selectedMonth = this.props.record.data[this.props.selectedMonth];

Choose a reason for hiding this comment

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

If selectedMonth is undefined or invalid, this could fail silently.

Choose a reason for hiding this comment

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

If a user has selected "31" for the day and then changes the month to one with only 30 days, what happens? 🤔

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.

4 participants