Created
May 19, 2020 08:30
-
-
Save kedramon/9b31fba59a552e9b2abbc2256d0c71e0 to your computer and use it in GitHub Desktop.
Date field rendered as custom date field using view options array.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$options = [ | |
'label' => 'inline', | |
'settings' => ['date_format' => 'd.m.Y'], | |
'type' => 'datetime_custom', | |
]; | |
$date = $entity->get('field_date')->view($options); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment