Increase max allowed granularity in Time ago formatter

Created on 2 January 2024, 6 months ago
Updated 17 February 2024, 4 months ago

Problem/Motivation

The DateFormatter::formatInterval method can handle 7 different levels of granularity. One per datetime unit.

  1. year
  2. month
  3. week
  4. day
  5. hour
  6. min
  7. sec

However, the TimeAgo formatter limits this option to 6 by some reason.

Steps to reproduce

  1. Add timestamp field to some content type.
  2. Set the granularity formatter setting to max allowed value which is 6.
  3. Create a node and set the timestamp value to some date far in the past.
  4. Notice that the rendered interval does not include seconds.

Proposed resolution

Increase max allowed granularity in Time ago formatter by one.

โœจ Feature request
Status

Fixed

Version

11.0 ๐Ÿ”ฅ

Component
Baseย  โ†’

Last updated 37 minutes ago

Created by

๐Ÿ‡ท๐Ÿ‡บRussia Chi

Live updates comments and jobs are added and updated live.
  • Novice

    It would make a good project for someone who is new to the Drupal contribution process. It's preferred over Newbie.

Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.69.0 2024