calculate delivery date fix
This commit is contained in:
@@ -15,7 +15,7 @@ $(document).ready(
|
|||||||
window.onbeforeunload = confirmExit;
|
window.onbeforeunload = confirmExit;
|
||||||
// prevent submit by enter press
|
// prevent submit by enter press
|
||||||
lockEnter();
|
lockEnter();
|
||||||
// parent info
|
|
||||||
$("#delivery_date").on('inputchange', function () {
|
$("#delivery_date").on('inputchange', function () {
|
||||||
calculateDate($("#delivery_date").val());
|
calculateDate($("#delivery_date").val());
|
||||||
});
|
});
|
||||||
@@ -157,6 +157,7 @@ $(document).ready(
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
AddSearchRecord();
|
AddSearchRecord();
|
||||||
|
calculateDate($("#delivery_date").val());
|
||||||
$(".loading_panel").css("display", "none");
|
$(".loading_panel").css("display", "none");
|
||||||
});
|
});
|
||||||
// handle save
|
// handle save
|
||||||
@@ -187,7 +188,6 @@ check_form = function(formname,event) {
|
|||||||
$("#position_list").val(JSON.stringifyNoSecurity(items));
|
$("#position_list").val(JSON.stringifyNoSecurity(items));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (check_form_(formname) === true) {
|
if (check_form_(formname) === true) {
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
@@ -196,6 +196,7 @@ check_form = function(formname,event) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
function confirmExit() {
|
function confirmExit() {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,6 +23,13 @@ switch ($_POST['job']) {
|
|||||||
function calculateDate($date){
|
function calculateDate($date){
|
||||||
$date = new Datetime($date);
|
$date = new Datetime($date);
|
||||||
$date->modify('-1 day');
|
$date->modify('-1 day');
|
||||||
|
$tmp['date']=$date->format("d.m.Y");
|
||||||
|
$tmp['date_day']=date('N', strtotime($tmp['date']));
|
||||||
|
if($tmp['date_day']==7){
|
||||||
|
$date->modify('-2 day');
|
||||||
|
} else if($tmp['date_day']==6){
|
||||||
|
$date->modify('-1 day');
|
||||||
|
}
|
||||||
$tmp['date']=$date->format("d.m.Y");
|
$tmp['date']=$date->format("d.m.Y");
|
||||||
echo json_encode($tmp);
|
echo json_encode($tmp);
|
||||||
return '';
|
return '';
|
||||||
|
|||||||
Reference in New Issue
Block a user