From 936f6579ff5d611a46b6649fcffe8d6bdbdf16f9 Mon Sep 17 00:00:00 2001 From: Lewhe Onesine <55294457+onesine@users.noreply.github.com> Date: Fri, 16 Aug 2024 12:58:09 +0100 Subject: [PATCH] Revert "Feature Time Picker" --- pages/index.js | 24 +---- src/components/Calendar/Days.tsx | 4 +- src/components/Calendar/Months.tsx | 2 +- src/components/Calendar/Week.tsx | 6 +- src/components/Calendar/Years.tsx | 5 +- src/components/Calendar/index.tsx | 40 +++----- src/components/Datepicker.tsx | 59 +++--------- src/components/Footer.tsx | 25 +---- src/components/Input.tsx | 35 ++----- src/components/Shortcuts.tsx | 2 +- src/components/Time.tsx | 144 ----------------------------- src/components/utils.tsx | 4 +- src/constants/index.ts | 2 - src/contexts/DatepickerContext.ts | 25 +---- src/helpers/index.ts | 29 +----- src/types/index.ts | 3 - 16 files changed, 63 insertions(+), 346 deletions(-) delete mode 100644 src/components/Time.tsx diff --git a/pages/index.js b/pages/index.js index 8064ac49..61ddfafc 100644 --- a/pages/index.js +++ b/pages/index.js @@ -11,11 +11,10 @@ export default function Playground() { endDate: null }); const [primaryColor, setPrimaryColor] = useState("blue"); - const [useRange, setUseRange] = useState(false); - const [showFooter, setShowFooter] = useState(true); + const [useRange, setUseRange] = useState(true); + const [showFooter, setShowFooter] = useState(false); const [showShortcuts, setShowShortcuts] = useState(false); - const [asTimePicker, setAsTimePicker] = useState(true); - const [asSingle, setAsSingle] = useState(true); + const [asSingle, setAsSingle] = useState(false); const [placeholder, setPlaceholder] = useState(""); const [separator, setSeparator] = useState("~"); const [i18n, setI18n] = useState("en"); @@ -23,7 +22,7 @@ export default function Playground() { const [inputClassName, setInputClassName] = useState(""); const [containerClassName, setContainerClassName] = useState(""); const [toggleClassName, setToggleClassName] = useState(""); - const [displayFormat, setDisplayFormat] = useState("DD/MM/YYYY hh:mm A"); + const [displayFormat, setDisplayFormat] = useState("YYYY-MM-DD"); const [readOnly, setReadOnly] = useState(false); const [minDate, setMinDate] = useState(""); const [maxDate, setMaxDate] = useState(""); @@ -94,7 +93,6 @@ export default function Playground() { } }} asSingle={asSingle} - asTimePicker={asTimePicker} placeholder={placeholder} separator={separator} startFrom={ @@ -191,20 +189,6 @@ export default function Playground() { -
-
- setAsTimePicker(e.target.checked)} - /> - -
-
= props => { ); return ( -
+
{calendarData.days.previous.map((item, index) => (