Skip to content

Commit

Permalink
Restrict month arrows in DatePicker (#5965)
Browse files Browse the repository at this point in the history
* Restrict month arrows in DatePicker

* fix position
  • Loading branch information
Ashesh3 authored Jul 28, 2023
1 parent cd1eced commit 326c0e2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Components/Common/DateInputV2.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,12 @@ const DateInputV2: React.FC<Props> = ({
<div className="flex">
<button
type="button"
disabled={!isDateWithinConstraints()}
disabled={
!isDateWithinConstraints(
getLastDay(),
datePickerHeaderDate.getMonth() - 1
)
}
className="aspect-square inline-flex cursor-pointer items-center justify-center rounded p-2 transition duration-100 ease-in-out hover:bg-gray-300"
onClick={decrement}
>
Expand Down
1 change: 1 addition & 0 deletions src/Components/Facility/DischargeModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ const DischargeModal = ({
{preDischargeForm.discharge_reason === "REC" && (
<div>
<DateFormField
position="LEFT"
label="Discharge Date"
name="discharge_date"
value={moment(preDischargeForm?.discharge_date).toDate()}
Expand Down

0 comments on commit 326c0e2

Please sign in to comment.