Skip to content

Commit abd1bba

Browse files
committed
docs: add custom format demo for range
1 parent 0d03666 commit abd1bba

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

docs/examples/range.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,17 @@ export default () => {
202202
disabledDate={disabledDate}
203203
/>
204204
</div>
205+
<div style={{ margin: '0 8px' }}>
206+
<h3>Custom Format</h3>
207+
<RangePicker<Moment>
208+
{...sharedProps}
209+
locale={zhCN}
210+
picker="year"
211+
format={(date, index) => {
212+
return index === 0 ? date.format('YYYY') : date.format('YYYY-MM-DD');
213+
}}
214+
/>
215+
</div>
205216
</div>
206217
</div>
207218
);

0 commit comments

Comments
 (0)