2019-09-11 06:28:46 +00:00
|
|
|
import React from "react";
|
2021-03-02 13:01:12 +00:00
|
|
|
import Calendar from "./";
|
2019-08-23 12:23:22 +00:00
|
|
|
|
2021-03-02 13:01:12 +00:00
|
|
|
export default {
|
|
|
|
title: "Components/Calendar",
|
|
|
|
component: Calendar,
|
|
|
|
argTypes: {
|
2021-03-07 11:57:26 +00:00
|
|
|
themeColor: { control: "color" },
|
|
|
|
selectedDate: { control: "date" },
|
|
|
|
openToDate: { control: "date" },
|
|
|
|
maxDate: { control: "date" },
|
|
|
|
minDate: { control: "date" },
|
2021-03-02 13:01:12 +00:00
|
|
|
locale: {
|
|
|
|
control: {
|
|
|
|
type: "select",
|
|
|
|
options: [
|
|
|
|
"az",
|
|
|
|
"zh-cn",
|
|
|
|
"cs",
|
|
|
|
"nl",
|
|
|
|
"en-gb",
|
|
|
|
"en",
|
|
|
|
"fi",
|
|
|
|
"fr",
|
|
|
|
"de",
|
|
|
|
"de-ch",
|
|
|
|
"el",
|
|
|
|
"it",
|
|
|
|
"ja",
|
|
|
|
"ko",
|
|
|
|
"lv",
|
|
|
|
"pl",
|
|
|
|
"pt",
|
|
|
|
"pt-br",
|
|
|
|
"ru",
|
|
|
|
"sk",
|
|
|
|
"sl",
|
|
|
|
"es",
|
|
|
|
"tr",
|
|
|
|
"uk",
|
|
|
|
"vi",
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
2021-03-07 11:57:26 +00:00
|
|
|
onChange: { action: "onChange" },
|
2021-03-02 13:01:12 +00:00
|
|
|
},
|
|
|
|
parameters: {
|
|
|
|
docs: {
|
|
|
|
description: {
|
|
|
|
component: "Used to display custom calendar",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
2019-08-23 12:23:22 +00:00
|
|
|
|
2021-03-02 13:01:12 +00:00
|
|
|
const Template = (args) => {
|
|
|
|
return (
|
|
|
|
<Calendar
|
|
|
|
{...args}
|
|
|
|
maxDate={new Date(args.maxDate)}
|
|
|
|
selectedDate={new Date(args.selectedDate)}
|
|
|
|
openToDate={new Date(args.openToDate)}
|
|
|
|
minDate={new Date(args.minDate)}
|
2021-03-02 14:20:16 +00:00
|
|
|
locale="en"
|
2021-03-02 13:01:12 +00:00
|
|
|
/>
|
|
|
|
);
|
|
|
|
};
|
2019-09-11 06:28:46 +00:00
|
|
|
|
2021-03-02 13:01:12 +00:00
|
|
|
export const Default = Template.bind({});
|
2021-03-03 11:57:14 +00:00
|
|
|
Default.args = {
|
|
|
|
maxDate: new Date(new Date().getFullYear() + 1 + "/01/01"),
|
|
|
|
minDate: new Date("1970/01/01"),
|
|
|
|
selectedDate: new Date(),
|
|
|
|
openToDate: new Date(),
|
|
|
|
};
|