mirror of
https://github.com/magicbug/Cloudlog
synced 2024-11-22 00:07:14 +00:00
Add button to reset start time
This commit is contained in:
parent
f56e031946
commit
ad2d7e756c
@ -995,6 +995,12 @@ $(document).on('keypress',function(e) {
|
||||
}
|
||||
);
|
||||
});
|
||||
$('#reset_time').click(function() {
|
||||
var now = new Date();
|
||||
var localTime = now.getTime();
|
||||
var utc = localTime + (now.getTimezoneOffset() * 60000);
|
||||
$('#start_time').val(("0" + now.getUTCHours()).slice(-2)+':'+("0" + now.getUTCMinutes()).slice(-2)+':'+("0" + now.getUTCSeconds()).slice(-2));
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
@ -1124,7 +1130,6 @@ $(document).on('keypress',function(e) {
|
||||
$('#start_time').focusout(function() {
|
||||
if (manual && $('#start_time').val() != '') {
|
||||
$('#end_time').val($('#start_time').val());
|
||||
console.log("HERE!");
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -58,7 +58,7 @@
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<label for="start_time"><?php echo lang('general_word_time_on'); ?></label>
|
||||
<label for="start_time"><?php echo lang('general_word_time_on'); ?></label> <?php if ($_GET['manual'] != 1) { ?><i id="reset_time" data-toggle="tooltip" data-original-title="Reset start time" class="fas fa-stopwatch"></i><?php } ?>
|
||||
<input type="text" class="form-control form-control-sm input_start_time" name="start_time" id="start_time" value="<?php if (($this->session->userdata('start_time') != NULL && ((time() - $this->session->userdata('time_stamp')) < 24 * 60 * 60))) { echo substr($this->session->userdata('start_time'),0,5); } else {echo date('H:i'); } ?>" size="7" <?php echo ($_GET['manual'] == 0 ? "disabled" : ""); ?> required pattern="[0-2][0-9]:[0-5][0-9]">
|
||||
</div>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user