diff --git a/packages/main/src/webComponents/DynamicDateRange/DynamicDateRange.mdx b/packages/main/src/webComponents/DynamicDateRange/DynamicDateRange.mdx new file mode 100644 index 00000000000..f11bae4ce58 --- /dev/null +++ b/packages/main/src/webComponents/DynamicDateRange/DynamicDateRange.mdx @@ -0,0 +1,72 @@ +import { ControlsWithNote, DocsHeader, Footer } from '@sb/components'; +import { Canvas, Meta } from '@storybook/blocks'; +import * as ComponentStories from './DynamicDateRange.stories'; + + + + + +
+ +## Example + + + +## Properties + + + +## More examples + +### Value Change + + + +#### Code + +```tsx +function DynamicDateRangeComponent() { + const [selValue, setSelValue] = useState(""); + const [convertedDates, setConvertedDates] = useState(""); + return ( + <> + { + const selectedValue = e.detail.value; + setSelValue(JSON.stringify(selectedValue)); + + const dates = e.currentTarget.toDates(selectedValue); + setConvertedDates( + dates.map((date) => date.toLocaleString()).join(" - "), + ); + }} + /> +
+ + + + + + + + + + ); +} +``` + +