Style event date to match blog and news teaser

Created on 6 January 2025, 4 months ago

Problem/Motivation

The event teaser styling differs slightly from the blog/news styling. Need to style the event date to match the news/blog date.

Before:

After:

πŸ“Œ Task
Status

Active

Component

Track: Event

Created by

πŸ‡¦πŸ‡ΊAustralia pameeela

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @pameeela
  • πŸ‡¦πŸ‡ΊAustralia pameeela
  • πŸ‡ΊπŸ‡ΈUnited States phenaproxima Massachusetts
  • πŸ‡ΊπŸ‡ΈUnited States phenaproxima Massachusetts

    There is no MR open here and so I can't merge it, since I don't have permissions to do that. :(

  • πŸ‡¬πŸ‡§United Kingdom dunx

    I'd suggest using the same date format across the site for consistency too as well as changing the styling. So the "after" should be the following for the three blocks:

    Mon, 6 Jan 2025 // Mon, 24 Mar - Thu, 27 Mar 2025 // Fri, 23 Aug 2024

    Not a mix of shortened and full month name, and day sometimes before, sometimes after the month.

  • πŸ‡¦πŸ‡ΊAustralia pameeela

    The date format is updated in a separate issue.

  • Merge request !385Style event date β†’ (Merged) created by pameeela
  • πŸ‡¦πŸ‡ΊAustralia pameeela
  • Pipeline finished with Failed
    4 months ago
    Total: 60s
    #387855
  • πŸ‡¬πŸ‡§United Kingdom dunx

    Thanks.

  • Pipeline finished with Success
    4 months ago
    Total: 3119s
    #387884
  • πŸ‡ΊπŸ‡ΈUnited States thejimbirch Cape Cod, Massachusetts

    This makes sense. Blog and News use the node's date and are styled from .node_meta

    We should encourage any future content types that need a date field use field_event__date

    Marking as RTBC

  • πŸ‡ΊπŸ‡ΈUnited States phenaproxima Massachusetts
  • Pipeline finished with Skipped
    4 months ago
    #387954
  • πŸ‡ΊπŸ‡ΈUnited States phenaproxima Massachusetts

    Merged into 1.x. Thanks!

  • πŸ‡¬πŸ‡§United Kingdom dunx

    Not sure I agree with this:

    We should encourage any future content types that need a date field use field_event__date

    Field naming is important, so using an "event" date for anything other than an event content type is counter to best practice (code and config readability being top of the list for me on that one).
    We can certainly encourage similar date field configuration, but for new fields.

  • πŸ‡ΈπŸ‡°Slovakia poker10

    Agree with @dunx, that if we want to reuse this, field_date seems like a better and more universal alternative.

  • πŸ‡¦πŸ‡ΊAustralia pameeela

    I don't think it's true that the event date field would be reused anywhere you wanted a date, for one thing it's a date range (using Smart date), which is somewhat specific to events. Most instances of a date field would be simple date fields, not a range, right?

    Our naming strategy was that if a field was shared among the existing content types, it was named generically. If not, then it wasn't. We also observed that marketers don't care that much about field names! And those who do care about it can probably come up with their own naming conventions.

  • πŸ‡¬πŸ‡§United Kingdom dunx

    Yes... but we should be implementing best practice, so those marketing-types can follow our lead. Agree otherwise.

    I thought I'd check out the date formats, beyond the actual styling, which I agree is fixed.

    TLDR: Formats still not consistent on latest build. Perhaps we don't care, but it looks odd to me.

    Steps to reproduce:

    git clone https://git.drupalcode.org/project/drupal_cms.git
    cd drupal_cms
    ddev config --project-type=drupal11 --docroot=web --php-version=8.3
    ddev start
    ddev composer install 
    ddev launch
    • Complete initial installation.
    • Create simple block view of "Latest" to include Blogs, News and Event content types (see screenshot).

    • Use Layout Builder to add new Section to homepage.
    • Add my "Latest" block view to that Section and save.

    Date formats are still inconsistent.

    I created the first piece of news content for the site. The date format for that matches the Blog format.

  • πŸ‡¦πŸ‡ΊAustralia pameeela

    Oh I see, I thought you were saying they should be consist between the teaser and full view. I think it makes sense for the event to have more information. It is relevant what days of the week a conference occurs; it's not relevant what day of the week a news item was posted.

    The format itself is consistent with day month year, but the event has more info because it's relevant there.

  • πŸ‡¬πŸ‡§United Kingdom dunx

    Fine by me and agree that an event requires more info to be displayed and a different format with shortened months is sensible.

    My main point was with the rest of the date format inconsistencies, but these have been addressed, so thanks to whoever did that :)

    • The "After" shot on #OP shows Mon, Mar 24 - Thu, Mar 27 2025
    • My screenshot on #18 shows Sun, 23 Mar 2025, 2pm - Thu, 27 Mar 2025, 1:59pm

    The styling itself has been fixed and date formats have also been addressed.

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

Production build 0.71.5 2024