diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php index 54e35b5b..b22ccb00 100755 --- a/application/models/Logbook_model.php +++ b/application/models/Logbook_model.php @@ -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; } diff --git a/assets/js/sections/qso.js b/assets/js/sections/qso.js index fefe5484..fb7a2944 100644 --- a/assets/js/sections/qso.js +++ b/assets/js/sections/qso.js @@ -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();