Skip to content

Fix meetings end date when it is multiyear#16393

Merged
greenwoodt merged 7 commits intodevelopfrom
fix/meetings-end-date-multiyear
Mar 18, 2026
Merged

Fix meetings end date when it is multiyear#16393
greenwoodt merged 7 commits intodevelopfrom
fix/meetings-end-date-multiyear

Conversation

@andreslucena
Copy link
Copy Markdown
Member

@andreslucena andreslucena commented Mar 12, 2026

🎩 What? Why?

This PR follows-up the last changes in Meetings calendar listing, doing 3 things:

  • fixes the multi-year bug: when an end date has a different date with a different year than the start date (as a meeting that starts on December and finishes in January)
  • lower the size and make the date less bolder
  • changes the text size on small (text-xs) from 13px to 12px, as while checking this out with @decidim/product we noticed some inconsistencies with the Figma and Tailwind documentation. This should be 12px as far as we could see.

📌 Related Issues

Testing

  1. Sign in as admin
  2. Edit one of the meetings that you have in the content block of the homepage, changing the end date so it is in the next year
  3. Go to the frontend and see the date

📷 Screenshots

image

Before

image image

After

image image

♥️ Thank you!

Summary by CodeRabbit

  • New Features

    • Meetings spanning multiple years now show the end year with a dash separator (e.g., "2020 - 2021") in calendar displays.
  • Style

    • Day card typography reduced in size and weight.
    • Extra-small font size adjusted in configuration.
  • Tests

    • Added comprehensive tests covering meetings across days, months, and years.

@andreslucena andreslucena added the type: fix PRs that implement a fix for a bug label Mar 12, 2026
@andreslucena andreslucena changed the title Fix/meetings end date multiyear Fix meetings end date when it is multiyear Mar 12, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 12, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 92923486-1db7-474a-a8d8-e41358f9ee18

📥 Commits

Reviewing files that changed from the base of the PR and between 44e0430 and 96dce8d.

📒 Files selected for processing (2)
  • decidim-meetings/app/cells/decidim/meetings/dates_and_map_cell.rb
  • decidim-meetings/spec/cells/decidim/meetings/dates_and_map_cell_spec.rb
🚧 Files skipped from review as they are similar to previous changes (1)
  • decidim-meetings/spec/cells/decidim/meetings/dates_and_map_cell_spec.rb

📝 Walkthrough

Walkthrough

Adds year-awareness to meeting calendar rendering: new end_year and same_year? helpers, conditional end-year rendering in meeting templates, small stylesheet/tailwind tweaks, and expanded RSpec coverage for multi-day/multi-year meeting scenarios.

Changes

Cohort / File(s) Summary
Core Styling
decidim-core/app/packs/stylesheets/decidim/_cards.scss, decidim-core/lib/decidim/assets/tailwind/tailwind.config.js.erb
Adjusted calendar day typography (text-2xl bold → text-xl semibold) and changed Tailwind fontSize.xs from 13px12px.
Meetings Cells (logic)
decidim-meetings/app/cells/decidim/meetings/dates_and_map_cell.rb, decidim-meetings/app/cells/decidim/meetings/meeting_l_cell.rb
Added end_year and same_year?; updated same_month?/same_day? to short-circuit when end_time is blank and refined comparisons.
Meetings Templates
decidim-meetings/app/cells/decidim/meetings/dates_and_map/show.erb, decidim-meetings/app/cells/decidim/meetings/meeting_l/image.erb
Conditionally render a dash and the end year when meeting spans different years.
Tests
decidim-meetings/spec/cells/decidim/meetings/dates_and_map_cell_spec.rb, decidim-meetings/spec/cells/decidim/meetings/meeting_l_cell_spec.rb
Adds extensive RSpec coverage for single-day, multi-day, multi-month, and multi-year scenarios and for same_month?/same_day?/same_year? behavior.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related issues

Possibly related PRs

Suggested labels

release: v0.31

Suggested reviewers

  • github-actions
  • alecslupu

Poem

🐇 I hopped through dates to find the end,
A dash appeared — the years now blend.
Start and finish dressed in clear display,
A rabbit's tweak to brighten the day.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Linked Issues check ❓ Inconclusive The PR partially addresses issue #15719: it fixes multi-year date display and adjusts styling, but does not implement all requested features like removing AM/PM indicators or showing timezone only when needed. Confirm whether this PR is intended as a partial fix for #15719 or if remaining requirements will be addressed in a follow-up PR.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the primary change: fixing the display of meeting end dates when spanning multiple years, which is the core objective of this PR.
Out of Scope Changes check ✅ Passed All changes are within scope: multi-year date display fixes, styling adjustments (day size/weight and Tailwind xs size), and corresponding test coverage for the meetings module.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/meetings-end-date-multiyear
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Tip

You can make CodeRabbit's review stricter and more nitpicky using the `assertive` profile, if that's what you prefer.

Change the reviews.profile setting to assertive to make CodeRabbit's nitpick more issues in your PRs.

github-actions[bot]
github-actions bot previously approved these changes Mar 12, 2026
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (1)
decidim-meetings/spec/cells/decidim/meetings/dates_and_map_cell_spec.rb (1)

76-90: Good multi-year coverage, but missing test for nil end_time.

The multi-year test scenario is well-structured. However, unlike the MeetingLCell spec which includes a "when meeting has no end time" context (lines 81-95 in that file), this spec lacks coverage for meetings without an end_time.

Adding this test would help catch the nil guard issue flagged in the DatesAndMapCell review.

📝 Suggested test addition
context "when meeting has no end time" do
  let!(:meeting) { create(:meeting, :published, start_time: Time.new(2020, 10, 15, 10, 0, 0, 0), end_time: nil) }

  it "shows the start time's month" do
    expect(subject).to have_css(".meeting__calendar-month", text: "October")
  end

  it "shows the start time's day" do
    expect(subject).to have_css(".meeting__calendar-day", text: "15")
  end

  it "does not show separator" do
    expect(subject).to have_no_css(".meeting__calendar-separator")
  end
end
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@decidim-meetings/spec/cells/decidim/meetings/dates_and_map_cell_spec.rb`
around lines 76 - 90, The spec is missing coverage for a meeting with a nil
end_time in decidim/meetings/dates_and_map_cell_spec.rb; add a new context "when
meeting has no end time" that creates a published meeting with start_time set
(e.g., Time.new(2020,10,15,10,0,0)) and end_time: nil, then assert via the cell
subject that the start month's and day's elements (".meeting__calendar-month"
and ".meeting__calendar-day") are present and that the separator element
(".meeting__calendar-separator") is not present, mirroring the existing style
used in the other contexts so the DatesAndMapCell rendering handles nil end_time
safely.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@decidim-meetings/app/cells/decidim/meetings/dates_and_map_cell.rb`:
- Around line 24-26: The end_year method calls model.end_time without a
nil/blank guard which can raise when end_time is absent; update
decidim/meetings/dates_and_map_cell.rb's end_year to check for presence (e.g.
return nil or empty string unless model.end_time.present?) before calling l
model.end_time, format: "%Y", mirroring the guards used in MeetingLCell date
methods so the method is safe when end_time is missing.
- Around line 38-40: Add nil guards to the date comparison methods and end_year:
in same_year?, same_month?, and same_day? (methods in DatesAndMapCell) return
true immediately if end_time.blank? before calling .year/.month/.day to avoid
NoMethodError when end_time is nil; in end_year return an empty string (return
"" if end_time.blank?) before calling the localization helper. This mirrors
MeetingLCell's guards and prevents calling methods on nil.

---

Nitpick comments:
In `@decidim-meetings/spec/cells/decidim/meetings/dates_and_map_cell_spec.rb`:
- Around line 76-90: The spec is missing coverage for a meeting with a nil
end_time in decidim/meetings/dates_and_map_cell_spec.rb; add a new context "when
meeting has no end time" that creates a published meeting with start_time set
(e.g., Time.new(2020,10,15,10,0,0)) and end_time: nil, then assert via the cell
subject that the start month's and day's elements (".meeting__calendar-month"
and ".meeting__calendar-day") are present and that the separator element
(".meeting__calendar-separator") is not present, mirroring the existing style
used in the other contexts so the DatesAndMapCell rendering handles nil end_time
safely.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: dd37ad3f-6e9c-475f-8698-bcb0b7151e0c

📥 Commits

Reviewing files that changed from the base of the PR and between adfca50 and ca72820.

📒 Files selected for processing (8)
  • decidim-core/app/packs/stylesheets/decidim/_cards.scss
  • decidim-core/lib/decidim/assets/tailwind/tailwind.config.js.erb
  • decidim-meetings/app/cells/decidim/meetings/dates_and_map/show.erb
  • decidim-meetings/app/cells/decidim/meetings/dates_and_map_cell.rb
  • decidim-meetings/app/cells/decidim/meetings/meeting_l/image.erb
  • decidim-meetings/app/cells/decidim/meetings/meeting_l_cell.rb
  • decidim-meetings/spec/cells/decidim/meetings/dates_and_map_cell_spec.rb
  • decidim-meetings/spec/cells/decidim/meetings/meeting_l_cell_spec.rb

github-actions[bot]
github-actions bot previously approved these changes Mar 12, 2026
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
decidim-meetings/spec/cells/decidim/meetings/meeting_l_cell_spec.rb (1)

108-110: Tighten the separator assertion to the year block.

This currently passes if any calendar separator exists; scope it to .card__calendar-year to validate the multi-year behavior directly.

Suggested diff
-      it "shows the separator" do
-        expect(subject).to have_css(".card__calendar-separator")
+      it "shows the year separator" do
+        expect(subject).to have_css(".card__calendar-year .card__calendar-separator")
       end
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@decidim-meetings/spec/cells/decidim/meetings/meeting_l_cell_spec.rb` around
lines 108 - 110, The test "it shows the separator" currently checks for any
calendar separator; narrow it to the year block by asserting the separator
exists inside the `.card__calendar-year` element (e.g. expect(subject) to have
CSS selector combining `.card__calendar-year` and `.card__calendar-separator`),
so update the assertion in the example that defines the subject to look for
`.card__calendar-year .card__calendar-separator` instead of just
`.card__calendar-separator`.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@decidim-meetings/spec/cells/decidim/meetings/meeting_l_cell_spec.rb`:
- Around line 108-110: The test "it shows the separator" currently checks for
any calendar separator; narrow it to the year block by asserting the separator
exists inside the `.card__calendar-year` element (e.g. expect(subject) to have
CSS selector combining `.card__calendar-year` and `.card__calendar-separator`),
so update the assertion in the example that defines the subject to look for
`.card__calendar-year .card__calendar-separator` instead of just
`.card__calendar-separator`.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 8ddba235-1535-405f-8b41-6d1402e2684b

📥 Commits

Reviewing files that changed from the base of the PR and between ca72820 and 44e0430.

📒 Files selected for processing (3)
  • decidim-meetings/app/cells/decidim/meetings/dates_and_map_cell.rb
  • decidim-meetings/spec/cells/decidim/meetings/dates_and_map_cell_spec.rb
  • decidim-meetings/spec/cells/decidim/meetings/meeting_l_cell_spec.rb
🚧 Files skipped from review as they are similar to previous changes (1)
  • decidim-meetings/spec/cells/decidim/meetings/dates_and_map_cell_spec.rb

coderabbitai[bot]
coderabbitai bot previously approved these changes Mar 12, 2026
github-actions[bot]
github-actions bot previously approved these changes Mar 13, 2026
@andreslucena andreslucena force-pushed the fix/meetings-end-date-multiyear branch from 90f4acc to 5462d14 Compare March 13, 2026 12:09
@andreslucena andreslucena force-pushed the fix/meetings-end-date-multiyear branch from 5462d14 to 8cf9405 Compare March 13, 2026 12:09
Copy link
Copy Markdown
Member

@greenwoodt greenwoodt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Looks good on mobile too!

Image

You'll need to have a look at the errors on Core in the CI

Copy link
Copy Markdown
Member

@greenwoodt greenwoodt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merging with a green CI

Image

@greenwoodt greenwoodt merged commit a3753c7 into develop Mar 18, 2026
85 of 86 checks passed
@greenwoodt greenwoodt deleted the fix/meetings-end-date-multiyear branch March 18, 2026 09:14
@greenwoodt greenwoodt added release: v0.30 Issues or PRs that need to be tackled for v0.30 release: v0.31 Issues or PRs that need to be tackled for v0.31 labels Mar 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Critical multi-day meeting display issues

2 participants