Skip to content

Commit 8d3bdcc

Browse files
Merge pull request #5989 from liferay/LPD-52104
fix(@clayui/@date-picker): LPD-51204 Bug selected year not displaying and year menu wrapping years to multiple lines
2 parents bd790d0 + 493494b commit 8d3bdcc

File tree

3 files changed

+18
-18
lines changed

3 files changed

+18
-18
lines changed

packages/clay-date-picker/docs/date-picker.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export default function App() {
4747
placeholder="YYYY-MM-DD"
4848
value={value}
4949
years={{
50-
end: 2024,
50+
end: new Date().getFullYear(),
5151
start: 1997,
5252
}}
5353
/>
@@ -81,7 +81,7 @@ export default function App() {
8181
timezone="GMT+01:00"
8282
value={value}
8383
years={{
84-
end: 2024,
84+
end: new Date().getFullYear(),
8585
start: 2008,
8686
}}
8787
/>
@@ -123,7 +123,7 @@ export default function App() {
123123
range
124124
value={value}
125125
years={{
126-
end: 2024,
126+
end: new Date().getFullYear(),
127127
start: 1997,
128128
}}
129129
/>
@@ -172,7 +172,7 @@ export default function App() {
172172
value={value}
173173
weekdaysShort={['Вс', 'Пн', 'Вт', 'Ср', 'Чт', 'Пт', 'Сб']}
174174
years={{
175-
end: 2024,
175+
end: new Date().getFullYear(),
176176
start: 2008,
177177
}}
178178
/>
@@ -221,7 +221,7 @@ export default function App() {
221221
placeholder="YYYY-MM-DD"
222222
value={value}
223223
years={{
224-
end: 2024,
224+
end: new Date().getFullYear(),
225225
start: 2008,
226226
}}
227227
/>

packages/clay-date-picker/src/DateNavigation.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ const ClayDatePickerDateNavigation = ({
111111
)
112112
}
113113
selectedKey={String(currentMonth.getFullYear())}
114-
width={85}
114+
width={95}
115115
>
116116
{(item) => (
117117
<Option key={item.value}>

packages/clay-date-picker/stories/DatePicker.stories.tsx

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ export const Default = () => (
4646
<ClayDatePickerWithState
4747
placeholder="YYYY-MM-DD"
4848
years={{
49-
end: 2024,
50-
start: 1997,
49+
end: new Date().getFullYear(),
50+
start: 1998,
5151
}}
5252
/>
5353
);
@@ -57,8 +57,8 @@ export const Disabled = () => (
5757
disabled
5858
placeholder="YYYY-MM-DD"
5959
years={{
60-
end: 2024,
61-
start: 1997,
60+
end: new Date().getFullYear(),
61+
start: 1998,
6262
}}
6363
/>
6464
);
@@ -70,8 +70,8 @@ export const Time = (args: any) => (
7070
timezone="GMT+01:00"
7171
use12Hours={args.use12Hours}
7272
years={{
73-
end: 2024,
74-
start: 1997,
73+
end: new Date().getFullYear(),
74+
start: 1998,
7575
}}
7676
/>
7777
);
@@ -103,8 +103,8 @@ export const Locale = () => (
103103
timezone="GMT+03:00"
104104
weekdaysShort={['Вс', 'Пн', 'Вт', 'Ср', 'Чт', 'Пт', 'Сб']}
105105
years={{
106-
end: 2024,
107-
start: 1997,
106+
end: new Date().getFullYear(),
107+
start: 1998,
108108
}}
109109
/>
110110
);
@@ -127,8 +127,8 @@ export const CustomExpand = () => {
127127
placeholder="YYYY-MM-DD"
128128
value={value}
129129
years={{
130-
end: 2024,
131-
start: 1997,
130+
end: new Date().getFullYear(),
131+
start: 1998,
132132
}}
133133
/>
134134
</>
@@ -145,8 +145,8 @@ export const DateRange = () => (
145145
placeholder="YYYY/MM/DD - YYYY/MM/DD"
146146
range
147147
years={{
148-
end: 2024,
149-
start: 1997,
148+
end: new Date().getFullYear(),
149+
start: 1998,
150150
}}
151151
/>
152152
);

0 commit comments

Comments
 (0)