orangehrm / orangehrm

OrangeHRM is a comprehensive Human Resource Management (HRM) System that captures all the essential functionalities required for any enterprise.
GNU General Public License v3.0
740 stars 538 forks source link

The time settings for 24-hour and 12-hour (am/pm) are missing. #1794

Open allmycookies opened 3 months ago

allmycookies commented 3 months ago

OrangeHRM version

5.5

Environment details

Describe the bug

When entering shifts, input in the 24-hour format is not allowed. Strictly, input with AM/PM is required. The timezone was set to Europe/Berlin during installation, but it has no impact on the system. The timezone cannot be changed afterwards, and this topic is not covered in the documentation.

Have I overlooked an option, or is this indeed a bug?

To reproduce

No response

Expected behavior

No response

Relevant log output

No response

ManulMax commented 3 months ago

Hi @allmycookies, For the time sheet we only allow to add 12HR format with AM and PM facility. And for the moment we don't have option to change timezone from product side. We will update the documentation and will consider to add these options in future release.

allmycookies commented 3 months ago

Okay, thank you for the response. I have identified the source code for the input mask and input validation as the chunk-vendors.js and app.js files. In these files, I replaced the occurrences of 'hh:mm a' with 'HH:mm' three times. Additionally, I modified the validation logic from if (t) { o(t.getHours() % 12 || 12, "hour"), o(t.getMinutes(), "minute"); to if (t) { o(t.getHours() % 24 || 24, "hour"), o(t.getMinutes(), "minute");, and I changed all conditional checks for 12-hour values in t > 0 && t <= 12 to 24-hour values. In this case the oxd-time-picker can function quite normal. So far, everything is now displayed in a 24-hour format. It's only a display issue for me, as the data is already stored in the database in a 24-hour format.