kopia lustrzana https://github.com/magicbug/Cloudlog
time off change day if time off in 00:xx
rodzic
19385baeb7
commit
ee33736e83
|
@ -10,6 +10,11 @@ class Logbook_model extends CI_Model {
|
||||||
$datetime = date("Y-m-d",strtotime($this->input->post('start_date')))." ". $this->input->post('start_time');
|
$datetime = date("Y-m-d",strtotime($this->input->post('start_date')))." ". $this->input->post('start_time');
|
||||||
if ($this->input->post('end_time') != null) {
|
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 {
|
} else {
|
||||||
$datetime_off = $datetime;
|
$datetime_off = $datetime;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1062,7 +1062,7 @@ function closeModal() {
|
||||||
}, 200)
|
}, 200)
|
||||||
}
|
}
|
||||||
|
|
||||||
// [TimeOff] test Consistency timeOff value //
|
// [TimeOff] test Consistency timeOff value (concidering start and end are between 23:00 and 00:59) //
|
||||||
function testTimeOffConsistency() {
|
function testTimeOffConsistency() {
|
||||||
var _start_time = $('#qso_input input[name="start_time"]').val();
|
var _start_time = $('#qso_input input[name="start_time"]').val();
|
||||||
var _end_time = $('#qso_input input[name="end_time"]').val();
|
var _end_time = $('#qso_input input[name="end_time"]').val();
|
||||||
|
|
Ładowanie…
Reference in New Issue