Update Show Patient, Birthdate dan BirthdateConversion
This commit is contained in:
parent
20a149188c
commit
97350a1f18
@ -82,17 +82,29 @@ class Patient extends Controller {
|
|||||||
} else {
|
} else {
|
||||||
|
|
||||||
$patient["Age"] = $this->calculateAgeFromBirthdate($patient["Birthdate"]);
|
$patient["Age"] = $this->calculateAgeFromBirthdate($patient["Birthdate"]);
|
||||||
|
|
||||||
$date = \DateTime::createFromFormat('Y-m-d H:i', $patient["Birthdate"]);
|
|
||||||
if ($date) {
|
|
||||||
// Simpan versi format database
|
|
||||||
$patient["Birthdate"] = $date->format('Y-m-d H:i');
|
|
||||||
|
|
||||||
// Simpan versi format tampilan
|
$Birthdate = \DateTime::createFromFormat('Y-m-d H:i', $patient["Birthdate"]);
|
||||||
$patient["BirthdateConversion"] = $date->format('j M Y');
|
if ($Birthdate) {
|
||||||
|
$patient["Birthdate"] = $Birthdate->format('Y-m-d H:i'); // Format database
|
||||||
|
$patient["BirthdateConversion"] = $Birthdate->format('j M Y'); // Format tampilan
|
||||||
} else {
|
} else {
|
||||||
$patient["BirthdateConversion"] = null; // Jika parsing gagal
|
$patient["Birthdate"] = null;
|
||||||
|
$patient["BirthdateConversion"] = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$CreateDate = \DateTime::createFromFormat('Y-m-d H:i', $patient["CreateDate"]);
|
||||||
|
if ($CreateDate) {
|
||||||
|
$patient["CreateDate"] = $CreateDate->format('Y-m-d H:i');
|
||||||
|
} else {
|
||||||
|
$patient["CreateDate"] = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
// $DisableDate = \DateTime::createFromFormat('Y-m-d H:i', $patient["CreateDate"]);
|
||||||
|
// if ($CreateDate) {
|
||||||
|
// $patient["CreateDate"] = $CreateDate->format('Y-m-d H:i');
|
||||||
|
// } else {
|
||||||
|
// $patient["CreateDate"] = null;
|
||||||
|
// }
|
||||||
|
|
||||||
if ($patient['LinkTo'] != null) {
|
if ($patient['LinkTo'] != null) {
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user