Problem/Motivation

Sometimes it’s necessary to use an unformatted field value, such as a node created date or publish date. There are date filters, but for the same reasons that date formats don’t work for AP Style, the twig filters don’t work.

Steps to reproduce

Use a raw date field or type value.

Proposed resolution

Create a twig filter to call the AP Style date formatter service.

Remaining tasks

Add config to ApStyleDateFormatter class to use as a default options for the formatTimestamp and formatRange functions.
Create twig extension service to use formatTimestamp.
In the future, options may be passed through the filter.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

shelane created an issue. See original summary.

  • shelane committed d44b93b on 8.x-1.x
    Issue #3221178 by shelane: Create twig filter to display date from raw...
shelane’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.