Waiting appointment bug fix

merge-update-with-lab-changes
haroon amjad 1 year ago
parent 605f02afe2
commit c6ee01c652

@ -280,23 +280,27 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments> wit
selectedDateJSON = freeSlotsResponse[0]; selectedDateJSON = freeSlotsResponse[0];
}); });
openTimeSlotsPickerForDate( openTimeSlotsPickerForDate(
(isLiveCareSchedule != null && isLiveCareSchedule) isWaitingAppointmentAvailable
? DateTime.now()
: (isLiveCareSchedule != null && isLiveCareSchedule)
? DateUtil.convertStringToDate(selectedDateJSON)
: DateUtil.convertStringToDateSaudiTimezone(
selectedDateJSON,
int.parse(
widget.doctor.projectID.toString(),
),
),
docFreeSlots);
_calendarController.selectedDate = isWaitingAppointmentAvailable
? DateTime.now()
: (isLiveCareSchedule != null && isLiveCareSchedule)
? DateUtil.convertStringToDate(selectedDateJSON) ? DateUtil.convertStringToDate(selectedDateJSON)
: DateUtil.convertStringToDateSaudiTimezone( : DateUtil.convertStringToDateSaudiTimezone(
selectedDateJSON, selectedDateJSON,
int.parse( int.parse(
widget.doctor.projectID.toString(), widget.doctor.projectID.toString(),
), ),
), );
docFreeSlots);
_calendarController.selectedDate = (isLiveCareSchedule != null && isLiveCareSchedule)
? DateUtil.convertStringToDate(selectedDateJSON)
: DateUtil.convertStringToDateSaudiTimezone(
selectedDateJSON,
int.parse(
widget.doctor.projectID.toString(),
),
);
_calendarController.displayDate = _calendarController.selectedDate; _calendarController.displayDate = _calendarController.selectedDate;
return _eventsParsed; return _eventsParsed;
} }
@ -360,16 +364,16 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments> wit
freeSlotsResponse = res['FreeTimeSlots']; freeSlotsResponse = res['FreeTimeSlots'];
_getJSONSlots().then((value) { _getJSONSlots().then((value) {
setState(() { setState(() {
_events.clear(); _events.clear();
_events = value; _events = value;
if (widget.doctorSchedule != null) if (widget.doctorSchedule != null) {
{ _onDaySelected(DateUtil.convertStringToDate(widget.doctorSchedule['Date']));
_onDaySelected(DateUtil.convertStringToDate(widget.doctorSchedule['Date'])); _calendarController.selectedDate = DateUtil.convertStringToDate(
_calendarController.selectedDate = DateUtil.convertStringToDate( widget.doctorSchedule['Date'],
widget.doctorSchedule['Date'], );
); }
}; ;
}); });
}); });
} else { } else {
DocAvailableAppointments.areAppointmentsAvailable = false; DocAvailableAppointments.areAppointmentsAvailable = false;

Loading…
Cancel
Save