-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(migration-events): change start and endDate to occuuredBefore and…
… occuredAfter
- Loading branch information
Showing
4 changed files
with
26 additions
and
14 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,27 @@ | ||
import i18n from '@dhis2/d2-i18n' | ||
import { hasValue, composeValidators } from '@dhis2/ui' | ||
import PropTypes from 'prop-types' | ||
import React from 'react' | ||
import { DATE_VALIDATOR } from '../DatePicker/DatePickerField.js' | ||
import { DatePickerField } from '../index.js' | ||
|
||
|
||
const NAME = 'startDate' | ||
const DATATEST = 'input-start-date' | ||
const LABEL = i18n.t('Start date') | ||
const VALIDATOR = composeValidators(hasValue, DATE_VALIDATOR) | ||
|
||
const StartDate = () => ( | ||
const StartDate = ({name, label}) => ( | ||
<DatePickerField | ||
name={NAME} | ||
name={name ?? NAME} | ||
validator={VALIDATOR} | ||
label={LABEL} | ||
label={label ?? LABEL} | ||
dataTest={DATATEST} | ||
/> | ||
) | ||
|
||
StartDate.propTypes = { | ||
label: PropTypes.string, | ||
name: PropTypes.string | ||
} | ||
export { StartDate } |
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