Added control for same-day and different hours planned downtimes

This commit is contained in:
Jose Gonzalez 2019-10-07 12:40:59 +02:00
parent 745971dfa6
commit 2b2f8417a7
1 changed files with 3 additions and 1 deletions

View File

@ -748,7 +748,9 @@ function planned_downtimes_created($values)
'return' => false,
'message' => __('Not created. Error inserting data').'. '.__('The end date must be higher than the current time'),
];
} else if ($values['type_execution'] == 'once' && $values['date_from'] >= $values['date_to']) {
} else if ($values['type_execution'] == 'once' && ($values['date_from'] > $values['date_to'])
|| (($values['date_from'] == $values['date_to']) && ($values['periodically_time_from'] >= $values['periodically_time_to']))
) {
return [
'return' => false,
'message' => __('Not created. Error inserting data').'. '.__('The end date must be higher than the start date'),