kopia lustrzana https://github.com/magicbug/Cloudlog
Fix QSO form to use user's preferred date format instead of hardcoded d-m-Y
Co-authored-by: magicbug <84308+magicbug@users.noreply.github.com>copilot/fix-3184
rodzic
df4a33e1e2
commit
db239bf0a3
|
@ -40,6 +40,13 @@ class QSO extends CI_Controller {
|
|||
$data['bands'] = $this->bands->get_user_bands_for_qso_entry();
|
||||
$data['user_default_band'] = $this->session->userdata('user_default_band');
|
||||
$data['sat_active'] = array_search("SAT", $this->bands->get_user_bands(), true);
|
||||
|
||||
// Set user's preferred date format
|
||||
if($this->session->userdata('user_date_format')) {
|
||||
$data['user_date_format'] = $this->session->userdata('user_date_format');
|
||||
} else {
|
||||
$data['user_date_format'] = $this->config->item('qso_date_format');
|
||||
}
|
||||
|
||||
$this->load->library('form_validation');
|
||||
|
||||
|
|
|
@ -69,8 +69,8 @@
|
|||
<input type="text" class="form-control form-control-sm input_date" name="start_date" id="start_date" value="<?php if (($this->session->userdata('start_date') != NULL && ((time() - $this->session->userdata('time_stamp')) < 24 * 60 * 60))) {
|
||||
echo $this->session->userdata('start_date');
|
||||
} else {
|
||||
echo date('d-m-Y');
|
||||
} ?>" <?php echo ($_GET['manual'] == 0 ? "disabled" : ""); ?> required pattern="[0-3][0-9]-[0-1][0-9]-[0-9]{4}">
|
||||
echo date($user_date_format);
|
||||
} ?>" <?php echo ($_GET['manual'] == 0 ? "disabled" : ""); ?> required>
|
||||
</div>
|
||||
|
||||
<div class="mb-3 col-md-3">
|
||||
|
@ -102,7 +102,7 @@
|
|||
<?php if ($_GET['manual'] == 0) { ?>
|
||||
<input class="input_start_time" type="hidden" id="start_time" name="start_time" value="<?php echo date('H:i:s'); ?>" />
|
||||
<input class="input_end_time" type="hidden" id="end_time" name="end_time" value="<?php echo date('H:i:s'); ?>" />
|
||||
<input class="input_date" type="hidden" id="start_date" name="start_date" value="<?php echo date('d-m-Y'); ?>" />
|
||||
<input class="input_date" type="hidden" id="start_date" name="start_date" value="<?php echo date($user_date_format); ?>" />
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
|
@ -113,8 +113,8 @@
|
|||
<input type="text" class="form-control form-control-sm input_date" name="start_date" id="start_date" value="<?php if (($this->session->userdata('start_date') != NULL && ((time() - $this->session->userdata('time_stamp')) < 24 * 60 * 60))) {
|
||||
echo $this->session->userdata('start_date');
|
||||
} else {
|
||||
echo date('d-m-Y');
|
||||
} ?>" <?php echo ($_GET['manual'] == 0 ? "disabled" : ""); ?> required pattern="[0-3][0-9]-[0-1][0-9]-[0-9]{4}">
|
||||
echo date($user_date_format);
|
||||
} ?>" <?php echo ($_GET['manual'] == 0 ? "disabled" : ""); ?> required>
|
||||
</div>
|
||||
|
||||
<div class="mb-3 col-md-6">
|
||||
|
@ -131,7 +131,7 @@
|
|||
|
||||
<?php if ($_GET['manual'] == 0) { ?>
|
||||
<input class="input_start_time" type="hidden" id="start_time" name="start_time" value="<?php echo date('H:i:s'); ?>" />
|
||||
<input class="input_date" type="hidden" id="start_date" name="start_date" value="<?php echo date('d-m-Y'); ?>" />
|
||||
<input class="input_date" type="hidden" id="start_date" name="start_date" value="<?php echo date($user_date_format); ?>" />
|
||||
<?php } ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
|
Ładowanie…
Reference in New Issue