Skip to content

Commit

Permalink
update openMrsDatepicker props
Browse files Browse the repository at this point in the history
  • Loading branch information
kajambiya committed Aug 1, 2024
1 parent 889b4d2 commit 37221bd
Show file tree
Hide file tree
Showing 2 changed files with 154 additions and 126 deletions.
11 changes: 5 additions & 6 deletions src/components/inputs/date/date.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,11 @@ const DateField: React.FC<FormFieldProps> = ({ question, onChange, handler, prev
return false;
}, [encounterContext.sessionMode, question.readonly, question.inlineRendering, layoutType, workspaceLayout]);

const onDateChange = (date: CalendarDate) => {
const refinedDate = date.toDate(getLocalTimeZone());
setTimeIfPresent(refinedDate, time);
setFieldValue(question.id, refinedDate);
onChange(question.id, refinedDate, setErrors, setWarnings);
handler?.handleFieldSubmission(question, refinedDate, encounterContext);
const onDateChange = (date: Date) => {
setTimeIfPresent(date, time);
setFieldValue(question.id, date);
onChange(question.id, date, setErrors, setWarnings);
handler?.handleFieldSubmission(question, date, encounterContext);
};

const setTimeIfPresent = (date: Date, time: string) => {
Expand Down
Loading

0 comments on commit 37221bd

Please sign in to comment.