time off change day if time off in 00:xx

pull/2772/head
abarrau 2023-12-04 21:32:16 +01:00
rodzic 19385baeb7
commit ee33736e83
2 zmienionych plików z 7 dodań i 2 usunięć

Wyświetl plik

@ -9,7 +9,12 @@ class Logbook_model extends CI_Model {
// Join date+time
$datetime = date("Y-m-d",strtotime($this->input->post('start_date')))." ". $this->input->post('start_time');
if ($this->input->post('end_time') != null) {
$datetime_off = date("Y-m-d",strtotime($this->input->post('start_date')))." ". $this->input->post('end_time');
$datetime_off = date("Y-m-d",strtotime($this->input->post('start_date')))." ". $this->input->post('end_time');
// if time off < time on, and time off is on 00:xx >> add 1 day (concidering start and end are between 23:00 and 00:59) //
$_tmp_datetime_off = strtotime($datetime_off);
if (($_tmp_datetime_off < strtotime($datetime)) && (substr($this->input->post('end_time'),0,2)=="00")) {
$datetime_off = date("Y-m-d H:i:s", ($_tmp_datetime_off + 60*60*24));
}
} else {
$datetime_off = $datetime;
}

Wyświetl plik

@ -1062,7 +1062,7 @@ function closeModal() {
}, 200)
}
// [TimeOff] test Consistency timeOff value //
// [TimeOff] test Consistency timeOff value (concidering start and end are between 23:00 and 00:59) //
function testTimeOffConsistency() {
var _start_time = $('#qso_input input[name="start_time"]').val();
var _end_time = $('#qso_input input[name="end_time"]').val();