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