Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add timer reset buttons #2653

Merged
merged 2 commits into from
Nov 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions application/views/interface_assets/footer.php
Original file line number Diff line number Diff line change
Expand Up @@ -1005,6 +1005,19 @@ function(dxspot) {
var utc = localTime + (now.getTimezoneOffset() * 60000);
$('#start_time').val(("0" + now.getUTCHours()).slice(-2)+':'+("0" + now.getUTCMinutes()).slice(-2)+':'+("0" + now.getUTCSeconds()).slice(-2));
});
$('#reset_start_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));
$('#end_time').val(("0" + now.getUTCHours()).slice(-2)+':'+("0" + now.getUTCMinutes()).slice(-2));
});
$('#reset_end_time').click(function() {
var now = new Date();
var localTime = now.getTime();
var utc = localTime + (now.getTimezoneOffset() * 60000);
$('#end_time').val(("0" + now.getUTCHours()).slice(-2)+':'+("0" + now.getUTCMinutes()).slice(-2));
});
});
</script>

Expand Down
13 changes: 12 additions & 1 deletion application/views/qso/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,20 @@
</div>

<div class="form-group col-md-3">
<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 } ?>
<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 } else { ?>
<i id="reset_start_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 $_GET['manual'] == 0 ? date('H:i:s') : date('H:i'); } ?>" size="7" <?php echo ($_GET['manual'] == 0 ? "disabled" : ""); ?> required pattern="[0-2][0-9]:[0-5][0-9]">
</div>

<div class="form-group col-md-3">
<label for="end_time"><?php echo lang('general_word_time_off'); ?></label>
<?php if ($_GET['manual'] == 1) { ?>
<i id="reset_end_time" data-toggle="tooltip" data-original-title="Reset end time" class="fas fa-stopwatch"></i>
<?php } ?>
<input type="text" class="form-control form-control-sm input_end_time" name="end_time" id="end_time" value="<?php if (($this->session->userdata('end_time') != NULL && ((time() - $this->session->userdata('time_stamp')) < 24 * 60 * 60))) { echo substr($this->session->userdata('end_time'),0,5); } else { echo $_GET['manual'] == 0 ? date('H:i:s') : date('H:i'); } ?>" size="7" <?php echo ($_GET['manual'] == 0 ? "disabled" : ""); ?> required pattern="[0-2][0-9]:[0-5][0-9]">
</div>

Expand All @@ -84,6 +92,9 @@

<div class="form-group col-md-6">
<label for="start_time"><?php echo lang('general_word_time'); ?></label>
<?php if ($_GET['manual'] == 1) { ?>
<i id="reset_start_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 $_GET['manual'] == 0 ? date('H:i:s') : date('H:i'); } ?>" size="7" <?php echo ($_GET['manual'] == 0 ? "disabled" : ""); ?> required pattern="[0-2][0-9]:[0-5][0-9]">
</div>

Expand Down
Loading