Skip to main content
added 2 characters in body
Source Link

An observation about what Duke said:

format_date() has been deprecated and will be removed before Drupal 9...

Yes, Drupal function format_date() defined in core/includes/common.inc is, in fact, deprecated. But, when you use the twig filter format_date() you are NOT calling that Drupal function, instead of that you are using the twig filter defined by Drupal in TwigExtension::getFilters(), and this filter calls DateFormatter::format().

Hence, using the twig filter format_date() is safe and Chris's solution 2 is fine.

An observation about what Duke said:

format_date() has been deprecated and will be removed before Drupal 9...

Yes, Drupal function format_date() defined in core/includes/common.inc is in fact deprecated. But, when you use the twig filter format_date() you are NOT calling that Drupal function, instead of that you are using the twig filter defined by Drupal in TwigExtension::getFilters(), and this filter calls DateFormatter::format().

Hence, using the twig filter format_date() is safe and Chris's solution 2 is fine.

An observation about what Duke said:

format_date() has been deprecated and will be removed before Drupal 9...

Yes, Drupal function format_date() defined in core/includes/common.inc is, in fact, deprecated. But, when you use the twig filter format_date() you are NOT calling that Drupal function, instead of that you are using the twig filter defined by Drupal in TwigExtension::getFilters(), and this filter calls DateFormatter::format().

Hence, using the twig filter format_date() is safe and Chris's solution 2 is fine.

Source Link

An observation about what Duke said:

format_date() has been deprecated and will be removed before Drupal 9...

Yes, Drupal function format_date() defined in core/includes/common.inc is in fact deprecated. But, when you use the twig filter format_date() you are NOT calling that Drupal function, instead of that you are using the twig filter defined by Drupal in TwigExtension::getFilters(), and this filter calls DateFormatter::format().

Hence, using the twig filter format_date() is safe and Chris's solution 2 is fine.