Update Show Patient, Birthdate dan BirthdateConversion
This commit is contained in:
parent
20a149188c
commit
97350a1f18
@ -82,17 +82,29 @@ class Patient extends Controller {
|
||||
} else {
|
||||
|
||||
$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
|
||||
$patient["BirthdateConversion"] = $date->format('j M Y');
|
||||
$Birthdate = \DateTime::createFromFormat('Y-m-d H:i', $patient["Birthdate"]);
|
||||
if ($Birthdate) {
|
||||
$patient["Birthdate"] = $Birthdate->format('Y-m-d H:i'); // Format database
|
||||
$patient["BirthdateConversion"] = $Birthdate->format('j M Y'); // Format tampilan
|
||||
} 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) {
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user