Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
alvindera97 opened this issue Oct 2, 2024 · 1 comment
Labels
bug This is a bug!

Comments

@alvindera97
Copy link
Contributor

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>

@alvindera97 alvindera97 added the bug This is a bug! label Oct 2, 2024
@alvindera97 alvindera97 changed the title Bug: Duplicate Scheduled Year String Appearing For Single Day Events Whose Schedule'd Year String Is Rendered Bug: Duplicate Scheduled Year String Appearing For Single Day Events Whose Scheduled Year String Is Rendered Oct 2, 2024
@alvindera97
Copy link
Contributor Author

#2627 should close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This is a bug!
Projects
None yet
Development

No branches or pull requests

1 participant