Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi there,
I have a date time field to input working hours and calculate total work hours.
Lets say the rule in office is:
Employee In 1: 07.00
Employee Out 1: 12.00
Employee In 2 : 13.00
Employee Out 2 : 17.00
It's mean that employee have 8 hours a day.
The question is, how can I calculate that employee is late in 2 ours if the field value like this:
filed Employee In 1: 08.00 <- late
field Employee Out 1: 12.00
field Employee In 2 : 13.00
field Employee Out 2 : 16.00 <- earlier out
is there any module date related or some one chould assist me.
Thanks before.
BR,
Comments
Comment #2
saurabh.dhariwal CreditAttribution: saurabh.dhariwal at AddWeb Solution Pvt. Ltd. commentedYou can override views template file and add below code. The below code will find difference between two in-timings and two out-timings and calculates total worked hours. This is assuming there won't be exactly 2 in and 2 out.
You can add any required calculations you require based on this.
Thanks!