RangeDatePicker Component Added

master
Pedram Keshavarzi 3 years ago
parent a7a5616438
commit bbbc005465
  1. 21
      src/components/RangeDatePicker/index.js
  2. 12
      src/redux/data.js

@ -0,0 +1,21 @@
import React, { useState } from "react";
import "../Calendar/index.css";
import DatePicker from "react-modern-calendar-datepicker";
const RangeDatePicker = () => {
const [selectedDayRange, setSelectedDayRange] = useState({
from: null,
to: null
});
return (
<DatePicker
value={selectedDayRange}
onChange={setSelectedDayRange}
inputPlaceholder="یک بازه زمانی انتخاب کنید"
shouldHighlightWeekends
locale='fa'
/>
);
};
export default RangeDatePicker;

@ -24,6 +24,8 @@ import Navbar from "../components/Navbar";
import SimpleCalendar from '../components/Calendar';
import Footer from "../components/Footer";
import SimpleDatePicker from "../components/SimpleDatePicker";
import RangeDatePicker from '../components/RangeDatePicker';
const components = [
{
name: "Button",
@ -486,6 +488,16 @@ const components = [
code: null,
},
},
{
name: "RangeDatePicker",
author: "Keshavarzi",
props: [],
content: {
name: "RangeDatePicker",
component: <RangeDatePicker />,
code: null,
},
},
];
export default components;

Loading…
Cancel
Save