@utrecht/calendar-react 1.0.14 → 1.0.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@utrecht/calendar-react",
3
- "version": "1.0.14",
3
+ "version": "1.0.15",
4
4
  "description": "Calendar component for the Municipality of Utrecht based on the NL Design System architecture",
5
5
  "keywords": [
6
6
  "nl-design-system"
@@ -56,8 +56,8 @@
56
56
  "clsx": "2.1.1",
57
57
  "date-fns": "2.30.0",
58
58
  "lodash-es": "4.17.21",
59
- "@utrecht/calendar-css": "2.0.1",
60
- "@utrecht/button-react": "2.0.10"
59
+ "@utrecht/button-react": "2.0.10",
60
+ "@utrecht/calendar-css": "2.0.1"
61
61
  },
62
62
  "devDependencies": {
63
63
  "@testing-library/dom": "8.20.1",
@@ -142,4 +142,13 @@ describe('Calendar', () => {
142
142
  if (nextMonthButton) fireEvent.click(nextMonthButton);
143
143
  expect(currentDateLabel).toContainHTML('april 2023');
144
144
  });
145
+
146
+ it('shows correct year in navigation label', () => {
147
+ const currentDate = new Date(2025, 11, 29);
148
+ const { container } = render(<Calendar onCalendarClick={() => {}} locale={nl} currentDate={currentDate} />);
149
+
150
+ let currentDateLabel = container.querySelector('.utrecht-calendar__navigation-label');
151
+
152
+ expect(currentDateLabel).toContainHTML('december 2025');
153
+ });
145
154
  });
package/src/index.tsx CHANGED
@@ -147,7 +147,7 @@ export const Calendar = ({
147
147
  onNextClick={() => setVisibleMonth(addMonths(visibleMonth, 1))}
148
148
  >
149
149
  <CalendarNavigationLabel dateTime={format(visibleMonth, 'yyyy-mm')}>
150
- {format(visibleMonth, 'LLLL Y', { locale })}
150
+ {format(visibleMonth, 'LLLL y', { locale })}
151
151
  </CalendarNavigationLabel>
152
152
  </CalendarNavigationButtons>
153
153
  </CalendarNavigationButtons>