Allow user to define date format

pull/420/head
Peter Goodhall 2020-02-21 11:40:05 +00:00
rodzic ad694204ef
commit c5aeab0ce0
6 zmienionych plików z 29 dodań i 7 usunięć

Wyświetl plik

@ -88,3 +88,24 @@ $config['public_search'] = FALSE;
*/
$config['callsign_tags'] = TRUE;
/*
|--------------------------------------------------------------------------
| Date Format
|--------------------------------------------------------------------------
|
| QSO Date format allows you to change the frontend display date to something
| that suits your region or operating style better.
|
| It uses the php date format so see https://www.php.net/manual/en/function.date.php
| for information on the layout.
|
| Example
| d/m/y = day/month/year
| Y/m/d = 2020/02/21
|
| Default is: d/m/y
|
*/
$config['qso_date_format'] = "d/m/y";

Wyświetl plik

@ -388,7 +388,7 @@ class Logbook extends CI_Controller {
foreach ($query->result() as $row)
{
$html .= "<tr>";
$html .= "<td>".date('d/m/y H:i',strtotime($row->COL_TIME_ON))."</td>";
$html .= "<td>".date($this->config->item('qso_date_format').' H:i',strtotime($row->COL_TIME_ON))."</td>";
$html .= "<td>".str_replace("0","&Oslash;",strtoupper($row->COL_CALL))."</td>";
$html .= "<td>".$row->COL_RST_SENT."</td>";
$html .= "<td>".$row->COL_RST_RCVD."</td>";

Wyświetl plik

@ -44,10 +44,11 @@
</tr>
</thead>
<?php $i = 0;
<?php
$i = 0;
foreach ($last_five_qsos->result() as $row) { ?>
<?php echo '<tr class="tr'.($i & 1).'">'; ?>
<td><?php $timestamp = strtotime($row->COL_TIME_ON); echo date('d/m/y', $timestamp); ?></td>
<td><?php $timestamp = strtotime($row->COL_TIME_ON); echo date($this->config->item('qso_date_format'), $timestamp); ?></td>
<?php if(($this->config->item('use_auth') && ($this->session->userdata('user_type') >= 2)) || $this->config->item('use_auth') === FALSE || ($this->config->item('show_time'))) { ?>
<td><?php $timestamp = strtotime($row->COL_TIME_ON); echo date('H:i', $timestamp); ?></td>
<?php } else { ?>

Wyświetl plik

@ -338,7 +338,7 @@
<?php $i = 0;
foreach ($query->result() as $row) { ?>
<?php echo '<tr class="tr'.($i & 1).'">'; ?>
<td><?php echo date('d/m/y H:i',strtotime($row->COL_TIME_ON)); ?></td>
<td><?php echo date($this->config->item('qso_date_format').' H:i',strtotime($row->COL_TIME_ON)); ?></td>
<td><a class="qsobox" data-fancybox data-type="iframe" data-src="<?php echo site_url('logbook/view')."/".$row->COL_PRIMARY_KEY; ?>" href="javascript:;"><?php echo str_replace("0","&Oslash;",strtoupper($row->COL_CALL)); ?></a></td>
<td><?php echo $row->COL_MODE; ?></td>
<td><?php echo $row->COL_RST_SENT; ?></td>

Wyświetl plik

@ -26,7 +26,7 @@
<?php $i = 0; foreach ($results->result() as $row) { ?>
<?php echo '<tr class="tr'.($i & 1).'">'; ?>
<td><?php $timestamp = strtotime($row->COL_TIME_ON); echo date('d/m/y', $timestamp); ?></td>
<td><?php $timestamp = strtotime($row->COL_TIME_ON); echo date($this->config->item('qso_date_format'), $timestamp); ?></td>
<?php if(($this->config->item('use_auth') && ($this->session->userdata('user_type') >= 2)) || $this->config->item('use_auth') === FALSE || ($this->config->item('show_time'))) { ?>
<td><?php $timestamp = strtotime($row->COL_TIME_ON); echo date('H:i', $timestamp); ?></td>
<?php } ?>

Wyświetl plik

@ -14,9 +14,9 @@
<tr>
<td>Date/Time:</td>
<?php if(($this->config->item('use_auth') && ($this->session->userdata('user_type') >= 2)) || $this->config->item('use_auth') === FALSE || ($this->config->item('show_time'))) { ?>
<td><?php $timestamp = strtotime($row->COL_TIME_ON); echo date('d/m/y', $timestamp); $timestamp = strtotime($row->COL_TIME_ON); echo " at ".date('H:i', $timestamp); ?></td>
<td><?php $timestamp = strtotime($row->COL_TIME_ON); echo date($this->config->item('qso_date_format'), $timestamp); $timestamp = strtotime($row->COL_TIME_ON); echo " at ".date('H:i', $timestamp); ?></td>
<?php } else { ?>
<td><?php $timestamp = strtotime($row->COL_TIME_ON); echo date('d/m/y', $timestamp); ?></td>
<td><?php $timestamp = strtotime($row->COL_TIME_ON); echo date($this->config->item('qso_date_format'), $timestamp); ?></td>
<?php } ?>
</tr>