@utrecht/calendar-react 1.0.14 → 1.0.16
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/dist/css.mjs +12 -3
- package/dist/css.mjs.map +1 -1
- package/dist/index.mjs +12 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +8 -8
- package/src/index.test.tsx +9 -0
- package/src/index.tsx +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@utrecht/calendar-react",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.16",
|
|
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"
|
|
@@ -55,24 +55,24 @@
|
|
|
55
55
|
"dependencies": {
|
|
56
56
|
"clsx": "2.1.1",
|
|
57
57
|
"date-fns": "2.30.0",
|
|
58
|
-
"lodash-es": "4.17.
|
|
59
|
-
"@utrecht/
|
|
60
|
-
"@utrecht/
|
|
58
|
+
"lodash-es": "4.17.23",
|
|
59
|
+
"@utrecht/button-react": "3.0.0",
|
|
60
|
+
"@utrecht/calendar-css": "2.0.1"
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
|
63
63
|
"@testing-library/dom": "8.20.1",
|
|
64
64
|
"@testing-library/jest-dom": "6.5.0",
|
|
65
65
|
"@testing-library/react": "16.0.1",
|
|
66
|
-
"@testing-library/user-event": "14.5.
|
|
67
|
-
"@types/jest": "29.5.
|
|
66
|
+
"@testing-library/user-event": "14.5.2",
|
|
67
|
+
"@types/jest": "29.5.14",
|
|
68
68
|
"@types/lodash-es": "4.17.12",
|
|
69
|
-
"@types/react": "18.3.
|
|
69
|
+
"@types/react": "18.3.27",
|
|
70
70
|
"@types/testing-library__jest-dom": "5.14.9",
|
|
71
71
|
"jest": "29.7.0",
|
|
72
72
|
"jest-environment-jsdom": "29.7.0",
|
|
73
73
|
"react": "18.3.1",
|
|
74
74
|
"rollup": "4.23.0",
|
|
75
|
-
"typescript": "5.6.
|
|
75
|
+
"typescript": "5.6.3",
|
|
76
76
|
"@utrecht/build-utils-react": "0.1.1"
|
|
77
77
|
},
|
|
78
78
|
"peerDependencies": {
|
package/src/index.test.tsx
CHANGED
|
@@ -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
|
|
150
|
+
{format(visibleMonth, 'LLLL y', { locale })}
|
|
151
151
|
</CalendarNavigationLabel>
|
|
152
152
|
</CalendarNavigationButtons>
|
|
153
153
|
</CalendarNavigationButtons>
|