diff --git a/src/data-workspace/inputs/date-input.js b/src/data-workspace/inputs/date-input.js index 8b8345dfe..4c0207d4c 100644 --- a/src/data-workspace/inputs/date-input.js +++ b/src/data-workspace/inputs/date-input.js @@ -1,5 +1,5 @@ +import { useConfig } from '@dhis2/app-runtime' import { CalendarInput } from '@dhis2/ui' -import cx from 'classnames' import React from 'react' import { useField } from 'react-final-form' import { useSetDataValueMutation, useUserInfo } from '../../shared/index.js' @@ -22,6 +22,10 @@ export const DateInput = ({ }, } = useUserInfo() + const { + systemInfo: { calendar }, + } = useConfig() + const { input, meta } = useField(fieldname, { subscription: { value: true, @@ -57,7 +61,7 @@ export const DateInput = ({ return ( { input.onFocus(...args) onFocus?.(...args) @@ -71,7 +75,7 @@ export const DateInput = ({ disabled={disabled} readOnly={locked} date={input.value} - calendar={'gregory'} + calendar={calendar} onDateSelect={(date) => { input.onChange(date?.calendarDateString) }} diff --git a/src/data-workspace/inputs/generic-input.js b/src/data-workspace/inputs/generic-input.js index 615e46cf1..bd4f1b4a6 100644 --- a/src/data-workspace/inputs/generic-input.js +++ b/src/data-workspace/inputs/generic-input.js @@ -17,7 +17,6 @@ import { } from './validators.js' const htmlTypeAttrsByValueType = { - [VALUE_TYPES.DATE]: 'date', [VALUE_TYPES.DATETIME]: 'datetime-local', [VALUE_TYPES.EMAIL]: 'email', [VALUE_TYPES.PHONE_NUMBER]: 'tel',