add minutes into talk message

This commit is contained in:
Tiavina 2025-04-02 12:19:35 +03:00
parent 26260359b6
commit 35f9f34c02
2 changed files with 15 additions and 3 deletions

View File

@ -3840,8 +3840,16 @@ class Bdd {
} }
$calendarData = $this->getCalendarDataByCalendarObjectUuid($devis->num); $calendarData = $this->getCalendarDataByCalendarObjectUuid($devis->num);
$devisTimeValue = VCalendarHelpers::GetStartAndEndTimeFromVCalendarString($calendarData); $devisTimeValue = VCalendarHelpers::GetStartAndEndTimeFromVCalendarString($calendarData);
$devis->startTime = $devisTimeValue["startTime"]; $startTimeValueWithMinutes = "";
$devis->endTime = $devisTimeValue["endTime"]; $endTimeValueWithMinutes = "";
if($devisTimeValue["datetimeStart"]){
$startTimeValueWithMinutes = $devisTimeValue["datetimeStart"]->format('H\hi');
}
if($devisTimeValue["datetimeEnd"]){
$endTimeValueWithMinutes = $devisTimeValue["datetimeEnd"]->format('H\hi');
}
$devis->startTime = $startTimeValueWithMinutes;
$devis->endTime = $endTimeValueWithMinutes;
$devisProducts = $this->getDevisProduits($devisId); $devisProducts = $this->getDevisProduits($devisId);
$devisProducts = json_encode($devisProducts); $devisProducts = json_encode($devisProducts);
$devisProducts = json_decode($devisProducts); $devisProducts = json_decode($devisProducts);
@ -3885,7 +3893,7 @@ class Bdd {
$message .= html_entity_decode($devis->nom_defunt); $message .= html_entity_decode($devis->nom_defunt);
$message .= ' $message .= '
le '.$devisDate; le '.$devisDate;
$message .= 'à '.$devis->startTime. ' '; $message .= ' à '.$devis->startTime. ' ';
$message .= ' $message .= '
à '.html_entity_decode($devis->lieu). ' '. html_entity_decode($devis->adresse_soin); à '.html_entity_decode($devis->lieu). ' '. html_entity_decode($devis->adresse_soin);

View File

@ -41,6 +41,8 @@ class VCalendarHelpers
$endTimeValue = ""; $endTimeValue = "";
$totalHours = 0; $totalHours = 0;
$totalWorkedHours = 0; $totalWorkedHours = 0;
$dateStart = null;
$dateEnd = null;
if($vCalendarString != ""){ if($vCalendarString != ""){
$dateStart = self::GetDateStartOrDateEndFromVCalendarString("DTSTART", $vCalendarString); $dateStart = self::GetDateStartOrDateEndFromVCalendarString("DTSTART", $vCalendarString);
if($dateStart != null){ if($dateStart != null){
@ -54,6 +56,8 @@ class VCalendarHelpers
$totalWorkedHours = DateHelpers::GetWorkingHoursBetweenDatetimeEndAndDatetimeStart($dateEnd,$dateStart); $totalWorkedHours = DateHelpers::GetWorkingHoursBetweenDatetimeEndAndDatetimeStart($dateEnd,$dateStart);
} }
return [ return [
"datetimeStart" => $dateStart,
"datetimeEnd" => $dateEnd,
"startTime" => $startTimeValue, "startTime" => $startTimeValue,
"endTime" => $endTimeValue, "endTime" => $endTimeValue,
"totalHours" => $totalHours, "totalHours" => $totalHours,