Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

(chore) O3-3701 update openMrsDatepicker props #357

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading