I need to enter the number of hours worked in a time sheet for a task. This needs to be in HH:MM format only. The hours needs to get summed up for a particular task.
If it increases 24 hrs then it needs to again get updated like total hrs worked on this task =25:45 hrs or 39:50 hrs like that. I first used jQuery timepicker and restricted it to 12 hrs, but don't know how to add and update the time durations, in hours as well as minutes.
I don't want AM / PM, just number of hours and minutes worked. Time interval =10 minutes.
Also the user must be able to add :30 minutes, :35 minutes, :40 minutes of work for a task. If you have seen Zoho portals, then you know how the log hours are added for a task. I want exactly the same way.
Here is what I have used-
<link rel="stylesheet" href="<?php echo base_url(); ?>assets/css/jquery.timepicker.css" >
<script src="<?php echo base_url(); ?>assets/javascripts/jquery.timepicker.min.js" ></script>
<section class="form-row">
<section class="form-row-left">
<label class="required" for="time_spent"><?php echo $this->lang->line('time_spent_hh_mm');?></label></section>
<section class="form-row-right">
<input class="" id="time_spent" name="time_spent" type="text">
<?php echo form_error('time_spent', '<div class="error">', '</div>'); ?>
</section>
<script>
$(document).ready(function () {
$('#time_spent').timepicker({
defaultTime: 'value',
minuteStep: 1,
disableFocus: true,
template: 'dropdown',
controlType: 'select',
timeFormat: "HH:mm",
ampm: false
});
});
</script>