-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: replaced single date picker for date range picker in the lab res…
…ults component. (#90) * fix: removed conditional rendering of date range picker on Tests Ordered component * feat: replaced single date picker for date range picker
- Loading branch information
1 parent
bc4a286
commit 3399318
Showing
8 changed files
with
64 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.dateRangePicker { | ||
flex-grow: unset; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { DatePicker, DatePickerInput } from '@carbon/react'; | ||
import React from 'react'; | ||
import styles from './orders-date-range-picker.scss'; | ||
import { useTranslation } from 'react-i18next'; | ||
|
||
export const OrdersDateRangePicker = ({ | ||
onChange, | ||
currentValues, | ||
}: { | ||
onChange: (dates: Array<Date>) => void; | ||
currentValues: Array<Date>; | ||
}) => { | ||
const currentDate = new Date(); | ||
const { t } = useTranslation(); | ||
return ( | ||
<DatePicker | ||
datePickerType="range" | ||
className={styles.dateRangePicker} | ||
onClose={onChange} | ||
maxDate={currentDate.toISOString()} | ||
value={currentValues} | ||
> | ||
<DatePickerInput | ||
id="date-picker-input-id-start" | ||
placeholder="mm/dd/yyyy" | ||
labelText={t('startDate', 'Start date')} | ||
size="md" | ||
/> | ||
<DatePickerInput | ||
id="date-picker-input-id-finish" | ||
placeholder="mm/dd/yyyy" | ||
labelText={t('endDate', 'End date')} | ||
size="md" | ||
/> | ||
</DatePicker> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters