mirror of
https://github.com/nextui-org/nextui.git
synced 2025-12-08 19:26:11 +00:00
* refactor(date): updated errorMessage story and modified to import props * docs(date): add errorMessageFunction examples * chore: add changeset * fix: remove unnecessary props * fix: typo
31 lines
610 B
TypeScript
31 lines
610 B
TypeScript
const App = `import {DateRangePicker} from "@nextui-org/react";
|
|
import {parseDate} from "@internationalized/date";
|
|
|
|
export default function App() {
|
|
return (
|
|
<DateRangePicker
|
|
isInvalid
|
|
label="Stay duration"
|
|
variant="bordered"
|
|
errorMessage={(value) => {
|
|
if (value.isInvalid) {
|
|
return "Please enter your stay duration";
|
|
}
|
|
}}
|
|
defaultValue={{
|
|
start: parseDate("2024-04-01"),
|
|
end: parseDate("2024-04-08"),
|
|
}}
|
|
className="max-w-xs"
|
|
/>
|
|
);
|
|
}`;
|
|
|
|
const react = {
|
|
"/App.jsx": App,
|
|
};
|
|
|
|
export default {
|
|
...react,
|
|
};
|