diff --git a/src/components/orders-table/orders-date-range-picker.scss b/src/components/orders-table/orders-date-range-picker.scss index efbc2de..7281b25 100644 --- a/src/components/orders-table/orders-date-range-picker.scss +++ b/src/components/orders-table/orders-date-range-picker.scss @@ -4,12 +4,23 @@ display: flex; gap: layout.$spacing-03; align-items: center; + margin-bottom: 0; + padding-bottom: 0; } .dateRangePicker { - flex-grow: unset; + display: flex; + gap: layout.$spacing-02; + align-items: center; + margin-bottom: 0; +} + +.datePickers { + display: flex; + gap: layout.$spacing-02; +} - input { - background-color: transparent; - } +.datePickers .bx--date-picker { + flex: 1; + min-width: 160px; } diff --git a/src/components/orders-table/orders-date-range-picker.tsx b/src/components/orders-table/orders-date-range-picker.tsx index af6aeaa..85e8d90 100644 --- a/src/components/orders-table/orders-date-range-picker.tsx +++ b/src/components/orders-table/orders-date-range-picker.tsx @@ -1,11 +1,37 @@ -import { DatePicker, DatePickerInput } from '@carbon/react'; -import { useAppContext } from '@openmrs/esm-framework'; -import dayjs from 'dayjs'; import React from 'react'; +import { useAppContext, OpenmrsDatePicker } from '@openmrs/esm-framework'; +import dayjs from 'dayjs'; import { useTranslation } from 'react-i18next'; import { DateFilterContext } from '../../types'; import styles from './orders-date-range-picker.scss'; +const OpenmrsDateRangePicker = ({ dateRange, onDateRangeChange, maxDate }) => { + const { t } = useTranslation(); + + const handleDateChange = (index, date) => { + const updatedDateRange = [...dateRange]; + updatedDateRange[index] = date; + onDateRangeChange(updatedDateRange); + }; + + return ( +
{t('dateRange', 'Date range')}:
+{t('dateRange', 'Date range')}:
-