Calender Event Fixes

merge-update-with-lab-changes
Aamir.Muhammad 2 years ago
parent 515896c265
commit 2e25940b62

@ -286,15 +286,10 @@ class _PrescriptionDetailsPageState extends State<PrescriptionDetailsPage> {
events.data!.forEach((element) { events.data!.forEach((element) {
print(widget.prescriptionReport!.itemDescriptionN!); print(widget.prescriptionReport!.itemDescriptionN!);
if (element.title!.contains(widget.prescriptionReport!.itemDescriptionN!)) calendarUtils.deleteEvent(calender, element); if (element.title!.contains(widget.prescriptionReport!.itemDescriptionN!)) calendarUtils.deleteEvent(calender, element);
}); });
}), }),
}); });
AppToast.showSuccessToast(message: TranslationBase.of(context).reminderCancelSuccess); AppToast.showSuccessToast(message: TranslationBase.of(context).reminderCancelSuccess);
setState(() { setState(() {
hasReminder = false; hasReminder = false;
@ -303,12 +298,10 @@ class _PrescriptionDetailsPageState extends State<PrescriptionDetailsPage> {
setCalender(BuildContext context, String eventId, int reminderIndex) async { setCalender(BuildContext context, String eventId, int reminderIndex) async {
DateTime actualDate = DateTime(DateTime.now().year, DateTime.now().month, DateTime.now().day, 8, 0); DateTime actualDate = DateTime(DateTime.now().year, DateTime.now().month, DateTime.now().day, 8, 0);
print("Frequency ${widget.prescriptionReport?.frequencyNumber}"); //Time will start at 8:00 AM from starting date
if (widget.prescriptionReport?.frequencyNumber == null) widget.prescriptionReport!.frequencyNumber = 2; //Some time frequency number is null so by default will be 2 if (widget.prescriptionReport?.frequencyNumber == null) widget.prescriptionReport!.frequencyNumber = 2; //Some time frequency number is null so by default will be 2
int remainingDays = widget.prescriptionReport!.days!; int remainingDays = widget.prescriptionReport!.days! -
// - (Jiffy.parseFromDateTime(DateTime.now()).diff(Jiffy.parseFromDateTime(DateUtil.convertStringToDate(widget.prescriptionReport!.orderDate!)), unit: Unit.day) as int);
// (Jiffy.parseFromDateTime(DateTime.now()).diff(Jiffy.parseFromDateTime(DateUtil.convertStringToDate(widget.prescriptionReport!.orderDate!)), unit: Unit.day) as int);
if (remainingDays.isNegative) { if (remainingDays.isNegative) {
Utils.showErrorToast("Prescription date has been already passed you can not add a reminder for this prescription."); Utils.showErrorToast("Prescription date has been already passed you can not add a reminder for this prescription.");
return; return;

Loading…
Cancel
Save