Skip to content

Commit

Permalink
(fix) KHP3-7497 : fix all day failing validation (#73)
Browse files Browse the repository at this point in the history
  • Loading branch information
donaldkibet authored Mar 5, 2025
1 parent c7a4273 commit 2d53c58
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"packages/*"
],
"scripts": {
"start": "openmrs develop --sources packages/esm-patient-registration-app packages/esm-patient-search-app --port 8075 --config-url https://dev.kenyahmis.org/openmrs/spa/openmrs.config.json https://dev.kenyahmis.org/openmrs/spa/kenyaemr.config.json --backend https://dev.kenyahmis.org",
"start": "openmrs develop --sources packages/esm-appointments-app --port 8090 --backend https://qa.kenyahmis.org --config-url https://qa.kenyahmis.org/openmrs/spa/kenyaemr.config.json https://qa.kenyahmis.org/openmrs/spa/openmrs.config.json ",
"ci:publish": "yarn workspaces foreach --all --topological --exclude @openmrs/esm-patient-management npm publish --access public --tag latest",
"ci:prepublish": "yarn workspaces foreach --all --topological --exclude @openmrs/esm-patient-management npm publish --access public --tag next",
"release": "yarn workspaces foreach --all --topological version",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ const AppointmentsForm: React.FC<AppointmentsFormProps & DefaultWorkspaceProps>
const defaultRecurringPatternDaysOfWeek = recurringPattern?.daysOfWeek || [];
const [isSuccessful, setIsSuccessful] = useState(false);
const [isSubmitting, setIsSubmitting] = useState(false);

// TODO can we clean this all up to be more consistent between using Date and dayjs?
const defaultStartDate = appointment?.startDateTime
? new Date(appointment?.startDateTime)
Expand All @@ -125,7 +124,7 @@ const AppointmentsForm: React.FC<AppointmentsFormProps & DefaultWorkspaceProps>
const defaultDuration =
appointment?.startDateTime && appointment?.endDateTime
? dayjs(appointment.endDateTime).diff(dayjs(appointment.startDateTime), 'minutes')
: undefined;
: null;

// t('durationErrorMessage', 'Duration should be greater than zero')
const appointmentsFormSchema = z
Expand Down Expand Up @@ -524,8 +523,9 @@ const AppointmentsForm: React.FC<AppointmentsFormProps & DefaultWorkspaceProps>
const previousServiceDuration = services?.find(
(service) => service.name === getValues('selectedService'),
)?.durationMins;
const selectedServiceDuration = services?.find((service) => service.name === event.target.value)
?.durationMins;
const selectedServiceDuration = services?.find(
(service) => service.name === event.target.value,
)?.durationMins;
if (selectedServiceDuration && previousServiceDuration === getValues('duration')) {
setValue('duration', selectedServiceDuration);
}
Expand Down

0 comments on commit 2d53c58

Please sign in to comment.