Leave to date and hour

Hi Dolibarr community,

Is there a way to make the Leave Start Date and End Date to date and hour?

Currently its mm/dd/yyy Morning | Afternoon.

Hi RomelWeltech,

A simple solution is to add complementary field like this:

To create a complementary field,

If you are particular about redundancy, look and feel etc, check this link:

myField : personalization of fields and of their access

If you a techie, try to play with /holiday/card.php and look for date fields and modify them in date and hour.

If this post address your requirement, please click on “Solution” check box so that others searching for the similar issue may find it useful.

thanks,
yesbee.

Hi RiseValinfotech,

Thank you for your quick reply.

I did try to use complementary attributes. I use a type Select field with times as values and trying the one you suggested the date and hour type field.

I thought there is some other way aside from modifying the code.

Unlike general shift leave that are minimum half days, I guess the time in hour comes into picture only when you have a shift system working 24 x 7.

Therefore, if you have already considered complementary attributes, I guess you have to check out the remaining two options.

tx
yesbee

Also, I did a quick check on the card.php. It seem to have logic in calculating number of days of leave based on half day triggers. Changing this would mean to re-write the code to check the leave balance in terms of hours and not days.

I guess, its complex and cannot be done without touching the code.

If you do this, kindly share the code on this forum for others to be useful as well.

thanks,
yesbee

I will just use the select type field with time as values.
This is just to record the time.

You have an idea what is causing such error when creating a leave with the following:
Start date: June 18, 2021 Morning
End date June 18, 2021 Morning

"Your leave request does not contain working day…"

I will see if there is anything I can do in touching up the code.

Thank you for a quick response RiseValInfotech

Hello everyone, i’m also interested in this modification!

I have done the complementary field but it’s not decreasing the remaining value, obviously because “Start date” and “End date” will do it.

Changing the code is not so easy but it’s the only way, the problem is that i don’t know php, i’m an ansi c developer :wink:

thanks to everyone that will help!

Hello there, Gozzini.

I also find it difficult to edit the code.

I didn’t even touch it, and I only added extra fields to record the time, but the problem is that the fields I added aren’t being recorded.

I’m hoping that someone in the community has come up with a solution.