浏览代码

fixed dob on patient

= 4 年之前
父节点
当前提交
33dac3546c
共有 2 个文件被更改,包括 8 次插入3 次删除
  1. 7 2
      app/Helpers/helpers.php
  2. 1 1
      resources/views/layouts/patient.blade.php

+ 7 - 2
app/Helpers/helpers.php

@@ -59,11 +59,16 @@ if(!function_exists('get_current_session')) {
 }
 
 if(!function_exists('friendly_date_time')) {
-    function friendly_date_time($value, $includeTime = true, $default = '-') {
+    function friendly_date_time($value, $includeTime = true, $default = '-', $long_year=false) {
         if(!$value || empty($value)) return $default;
         try {
             $result = strtotime($value);
-            $result = date("m/d/y" . ($includeTime ? ", h:ia" : ""), $result);
+            if($long_year){
+                $result = date("m/d/Y" . ($includeTime ? ", h:ia" : ""), $result);
+            }else{
+                $result = date("m/d/y" . ($includeTime ? ", h:ia" : ""), $result);
+            }
+
             return $result;
         }
         catch (Exception $e) {

+ 1 - 1
resources/views/layouts/patient.blade.php

@@ -296,7 +296,7 @@
                                             <i class=chart>[#{{$patient->chart_number}}]</i>
                                         </div>
                                         <div class=separators>
-                                            <div>{{friendly_date_time($patient->dob, false)}}({{$patient->age_in_years}}
+                                            <div>{{friendly_date_time($patient->dob, false,null, true)}}({{$patient->age_in_years}}
                                                 y.o {{$patient->sex}})
                                             </div>
                                             <div>