Skip to content

Bug: Duplicate Scheduled Year String Appearing For Single Day Events Whose Scheduled Year String Is Rendered #2626

Open
@alvindera97

Description

@alvindera97

Describe the bug

What

For single day events (events that start and end on the same day) that require year string to be displayed [which are]:

  • Single day events scheduled for a future year
  • Single day events that have passed rendered at the "You just missed..." section of the main events page {pythondotorg url}/events/

The year string is rendered multiple times.

Here are a couple of examples

1. Past event scenario

image

2. Future event scenario

image

To Reproduce

  • Set up a single day event scheduled to start in the future year or scheduled in the past (e.g. event has just been concluded)
  • Navigate to the main events page (http://localhost:8000/events) and observe the year string rendered multiple times.

Expected behavior

  • Single day events (regardless of schedule year) should only render a single year string (if necessary) since the event is guaranteed to start and end within the same year.

Addressing "If necessary"

  • Future single day event scheduled within the current year does not need to render the current year as there is no date/year ambiguity.
  • Past single day events (Events just missed) would need to render the year string dispelling any ambiguity on year event took place.

URL to the issue

No response

Screenshots

No response

Browsers

Firefox, Chrome, Safari, Microsoft Edge, Other

Operating System

Linux

Browser Version

No response

Relevant log output

No response

Additional context

I've traced down the offending template logic:

{% if next_time.single_day %}
<time datetime="{{ next_time.dt_start|date:'c' }}">{{ next_time.dt_start|date:"d N" }}
<span id="start-{{ object.id }}"{% if scheduled_start_this_year %} class="say-no-more"{% endif %}>
{{ next_time.dt_start|date:"Y" }}
</span>
<span id="start-{{ object.id }}"{% if scheduled_end_this_year %} class="say-no-more"{% endif %}>
{{ next_time.dt_start|date:"Y" }}
</span>

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThis is a bug!

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions