File tree Expand file tree Collapse file tree 2 files changed +19
-7
lines changed
src/resources/views/crud/columns Expand file tree Collapse file tree 2 files changed +19
-7
lines changed Original file line number Diff line number Diff line change 55 $column [' prefix' ] = $column [' prefix' ] ?? ' ' ;
66 $column [' suffix' ] = $column [' suffix' ] ?? ' ' ;
77 $column [' format' ] = $column [' format' ] ?? backpack_theme_config (' default_date_format' );
8+ $column [' locale' ] = $column [' locale' ] ?? App:: getLocale ();
89 $column [' text' ] = $column [' default' ] ?? ' -' ;
910
1011 if ($column [' value' ] instanceof \ Closure ) {
1112 $column [' value' ] = $column [' value' ]($entry );
1213 }
1314
1415 if (! empty ($column [' value' ])) {
15- $date = \Carbon \Carbon:: parse ($column [' value' ])
16- -> locale (App:: getLocale ())
17- -> isoFormat ($column [' format' ]);
16+ $date = \Carbon \Carbon:: parse ($column [' value' ]);
17+
18+ if ($column [' format' ] instanceof \ Closure ) {
19+ $date = $column [' format' ]($date , $entry );
20+ } else {
21+ $date = $date -> locale ($column [' locale' ])
22+ -> isoFormat ($column [' format' ]);
23+ }
1824
1925 $column [' text' ] = $column [' prefix' ]. $date . $column [' suffix' ];
2026 }
Original file line number Diff line number Diff line change 55 $column [' prefix' ] = $column [' prefix' ] ?? ' ' ;
66 $column [' suffix' ] = $column [' suffix' ] ?? ' ' ;
77 $column [' format' ] = $column [' format' ] ?? backpack_theme_config (' default_datetime_format' );
8+ $column [' locale' ] = $column [' locale' ] ?? App:: getLocale ();
89 $column [' text' ] = $column [' default' ] ?? ' -' ;
910
1011 if ($column [' value' ] instanceof \ Closure ) {
1112 $column [' value' ] = $column [' value' ]($entry );
1213 }
1314
1415 if (! empty ($column [' value' ])) {
15- $date = \Carbon \Carbon:: parse ($column [' value' ])
16- -> locale (App:: getLocale ())
17- -> isoFormat ($column [' format' ]);
16+ $date = \Carbon \Carbon:: parse ($column [' value' ]);
17+
18+ if ($column [' format' ] instanceof \ Closure ) {
19+ $date = $column [' format' ]($date , $entry );
20+ } else {
21+ $date = $date -> locale ($column [' locale' ])
22+ -> isoFormat ($column [' format' ]);
23+ }
1824
1925 $column [' text' ] = $column [' prefix' ]. $date . $column [' suffix' ];
2026 }
2834 {!! $column [' text' ] ! !}
2935 @endif
3036 @includeWhen (! empty ($column [' wrapper' ]), ' crud::columns.inc.wrapper_end' )
31- </span >
37+ </span >
You can’t perform that action at this time.
0 commit comments