Skip to content

Commit 5178c4e

Browse files
committed
doc: update samples with more explanation
1 parent 04d9074 commit 5178c4e

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

stories/JBDateInput.stories.tsx

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,22 @@ export const Gregorian: Story = {
3737
};
3838

3939
export const CustomFormat: Story = {
40+
render:(args)=>{
41+
const [value, setValue] = useState('');
42+
const [value2, setValue2] = useState('');
43+
return (
44+
<div>
45+
<h2>input.value in different format</h2>
46+
<p>try to input some value inside date-input and see the changes in the paragraphs below</p>
47+
<JBDateInput label="value with arguments format" format={args.format} value={value} onChange={(e)=>setValue(e.target.value)}/>
48+
<p>your inputted value is: {value}</p>
49+
<JBDateInput label="value with YYYY-MM-DD format" format="YYYY-MM-DD format" value={value2} onChange={(e)=>setValue2(e.target.value)}/>
50+
<p>your inputted value is: {value2}</p>
51+
</div>
52+
)
53+
},
4054
args: {
41-
label: "date",
4255
format: "YYYY/MM/DD",
43-
direction: "ltr",
4456
}
4557
};
4658

0 commit comments

Comments
 (0)