Next Open Day views display current day

Created on 14 November 2024, 2 days ago

Problem/Motivation

The view formatter for Number of days: Next open day
Display the current open day and not the next open day.
This is only in views, the default display set to Next open day displays the correct date

Steps to reproduce

Create a content type and add an office hours field.
Create content and fill in Monday to Sunday as office hours
Create a view (page or block) for a content type that has an office hours field.
Add the office hours field to the view and set Number of days to "Next open day"
The view will display the current date.
But the page display will show the correct date - The Next Day

πŸ› Bug report
Status

Active

Version

1.19

Component

Code - widget

Created by

πŸ‡ΏπŸ‡¦South Africa vlooi vlerke

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

Comments & Activities

  • Issue created by @vlooi vlerke
  • πŸ‡³πŸ‡±Netherlands johnv

    I cannot reproduce the error.
    I used a Views table display with fields, and get the following results (including the current-status), depending if the current day is open or (already) closed.
    The calculations are notoriously complicated, so perhaps you have an edge case?

    Thursday 11:00 when setting times 9-17hr:
    Node display:
    Currently open! Thu: 9:00-17:00
    WeekdayTime slotComment
    Thu: 9:00-17:00

    View:
    Currently open!
    WeekdayTime slotComment
    Th: 9:00-17:00

    Thursday 11:00 when setting times 9-10:30hr:
    Node display:
    Currently closed
    WeekdayTime slotComment
    Fri: 9:00-10:30

    View:
    Currently closed
    WeekdayTime slotComment
    Fr: 9:00-10:30

  • πŸ‡ΏπŸ‡¦South Africa vlooi vlerke

    Here is a screen shot of my view block.

    Today is Friday

    On the left in the body is the display formatter of the Office Hours field.
    The Next open day is correct in the body display.

    On the right is a view block with 3 Office Hours Fileds.
    1. Status
    2. Next Open Day (showing current day - broken)
    3. The Office hours timeslots

    I will do a clean install and test it again. Maybe the multiple fields in the block is causing the issues.

  • πŸ‡ΏπŸ‡¦South Africa vlooi vlerke

    I had the wrong field displayed in the body.
    The correct field is now displayed in the body and set to Next Open Day and has the same issue, showing the current date. The issue I am having is in both views and node display for the Next Day formatter.

  • πŸ‡³πŸ‡±Netherlands johnv
  • πŸ‡³πŸ‡±Netherlands johnv

    This is the functionality, from a 2013 ticket:
    "The option 'next open day' should show today's hours until the shop is closed.
    After that, tomorrow's hours are shown."

    If you need to display 'tomorrow' when the shop is still open, then you might want to throw in the 'Current status' option, then hide in your theming.

  • πŸ‡ΏπŸ‡¦South Africa vlooi vlerke

    When Office Hours are closed for the current day the Next Open Day works.

    When Office Hours are set to be open on the Same Day then Next Open Day displays Current Day

Production build 0.71.5 2024