I've got a few day's worth of "clock in" and "clock out" entries in military (24 hour) time that are plain numbers.
Clock In | Clock Out
--------------------
1020 | 1555
1116 | 1857
1049 | 1204
I've manually figured out that this person has worked 14 hours and 31 minutes. I have an HTML page that contains a lot of these entries in a class, so I use the following code to get them in Javascript:
$('.clockin').each(function() {clockinsum += +$(this).text()||0;});
$('.clockout').each(function() {clockoutsum += +$(this).text()||0;});
I'm not sure where to go from here, or if this is even the right way to start. Is there a way for Javascript/jQuery to calculate the hours and minutes worked from a bunch of these entries?