<?php

// Ajust datetime to time of file Config
$TimeStart = $_SESSION['Config']['start_time_day'];
$values['start_date'] = substr($values['start_date'],0,11).$TimeStart;

// Valor of Config
$hours_a_day =  $_SESSION['Config']['hours_a_day'];
$free_weekend = $_SESSION['Config']['free_weekend'];
include "MyCode/function_dates.php";   // Function of dates

if ( $values['duration_type'] == 1) {
		$increment_day = ceil($values['duration']/$hours_a_day);
		} else { 
		$increment_day = $values['duration'];
		}
$increment_day = $increment_day -1;
if ( $free_weekend == 'yes' ) {
		$values['end_date'] = getFutureBusinessDayWeek($increment_day, $values['start_date'],$_SESSION['holidays']);
		} else {
		$values['end_date'] = getFutureBusinessDay($increment_day, $values['start_date'],$_SESSION['holidays']);
		}

$TimeEnd = $_SESSION['Config']['end_time_day']; 
$values['end_date'] = $values['end_date'].' '.$TimeEnd;

?>