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

Custom hours daily #1091

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Conversation

Rameen260
Copy link

@Rameen260 Rameen260 commented Dec 10, 2024

Related issue

Closes #1077

Context / Background

Issue Description:
Describe the current limitation
In the current state you can choose days in the preferences and choose hours per day (for all days).

Describe the proposed feature or enhancement
Add option to choose hours per day for every day.
For example for days: Sun, Tue, Thu set hours-per-day to 10:15 and for Mon, Wed set hours-per-day to 11:45.

What change is being introduced by this PR?

- What changes did you make to achieve the goal? / How did you approach this problem?

  • Added a new section in the preferences.html/preferences.js page for "Hours per day" that dynamically displays inputs for working hours based on selected weekdays.
  • Also ensured that the new section is compatible and functional with the translation system set in place
  • Updated the parameters in user-preferences.js, then updated the logic in:

BaseCalender.js
FlexibleDayCalender.js
FlexibleMonthCalender.js
time-balance.js

to use these new params, and calculate the time to leave using the new daily hours

If the user works Mon-Fri:
image

If the user works on Mon and Fri:
image

- What are the indirect and direct consequences of the change?
Direct Consequences:

  • The "Hours per day" section dynamically adjusts to display inputs for the selected working days. This enables users to set specific working hours for each day.
  • Users now have greater flexibility to customize their preferences, improving the overall usability.

Indirect Consequence:
As a result one test case from "npm run test:jest" is failing, this is based on the old logic, where hours per day was a single value, So it was bound to fail, this needs to be updated in the case this issue is resolved.
image

How will this be tested?

- How will you verify whether your changes worked as expected once merged?

  • As of now it is functional, once merged, manual testing of the "Hours per day" section can be done to verify that inputs are displayed, updated, and saved correctly.
  • Additionally, the old logic's unit test can be updated to ensure this functionality is working with future updates.

  • I confirm I'm a native or fluent speaker of the language I'm translating to.

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.

Customize hours per day
1 participant