Skip to content

Commit

Permalink
feat: DHIS2-10312 adds default value in enrolment date (#1505)
Browse files Browse the repository at this point in the history
* chore: adds default value in enrolment date

* chore: no moment
  • Loading branch information
paschalidi authored Feb 24, 2021
1 parent c5aee50 commit 2c72bbb
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { openDataEntryForNewEnrollment } from './open.actions';
import { getEnrollmentDateValidatorContainer, getIncidentDateValidatorContainer } from '../fieldValidators';
import { convertGeometryOut } from '../../converters';
import { getGeneratedUniqueValuesAsync } from '../../common/TEIAndEnrollment';
import { convertDateObjectToDateFormatString } from '../../../../utils/converters/date';

const itemId = 'newEnrollment';

Expand Down Expand Up @@ -55,7 +56,7 @@ export const openDataEntryForNewEnrollmentBatchAsync = async (
dataEntryId,
itemId,
[...dataEntryPropsToInclude, ...extraDataEntryProps],
null,
{ enrollmentDate: convertDateObjectToDateFormatString(new Date()) },
generatedItemContainers
.reduce((accValuesByKey, container) => {
accValuesByKey[container.id] = container.item.value;
Expand Down

0 comments on commit 2c72bbb

Please sign in to comment.