diff --git a/lib/View/booking/screen/booking_car_screen.dart b/lib/View/booking/screen/booking_car_screen.dart index ed0e5f4..2cf60e9 100644 --- a/lib/View/booking/screen/booking_car_screen.dart +++ b/lib/View/booking/screen/booking_car_screen.dart @@ -338,28 +338,15 @@ class _BookingCarScreenState extends State { }); } else { - setState(() { - startDate = (start == null) ? null : DateTime(start.year, start.month, start.day); + startDate = (start == null) ? null : DateTime(start.year, start.month, start.day, (startTime == -1) ? 0 : startTime); endDate = (end == null) - ? DateTime(start!.year, start!.month, start!.day) - : DateTime(end.year, end.month, end.day); + ? DateTime(start!.year, start!.month, start!.day, (startTime == -1) ? 0 : startTime) + : DateTime(end.year, end.month, end.day, (endTime == -1) ? 0 : endTime); }); } } - void changedStartDate(DateTime? time) { - setState(() { - startDate = (time == null) ? null : DateTime(time.year, time.month, time.day); - }); - } - - void changedEndDate(DateTime? time) { - setState(() { - endDate = (time == null) ? null : DateTime(time.year, time.month, time.day); - }); - } - void didTapResetTimeGridButton() { setState(() { startTime = -1; diff --git a/lib/View/booking/screen/booking_resource_screen.dart b/lib/View/booking/screen/booking_resource_screen.dart index 429c5ef..3d99b27 100644 --- a/lib/View/booking/screen/booking_resource_screen.dart +++ b/lib/View/booking/screen/booking_resource_screen.dart @@ -340,22 +340,14 @@ class _BookingResourceScreenState extends State { } else { setState(() { - startDate = (start == null) ? null : DateTime(start.year, start.month, start.day); + startDate = (start == null) ? null : DateTime(start.year, start.month, start.day, (startTime == -1) ? 0 : startTime); endDate = (end == null) - ? DateTime(start!.year, start!.month, start!.day) - : DateTime(end.year, end.month, end.day); + ? DateTime(start!.year, start!.month, start!.day, (startTime == -1) ? 0 : startTime) + : DateTime(end.year, end.month, end.day, (endTime == -1) ? 0 : endTime); }); } } - void changedStartDate(DateTime? time) { - setState(() { startDate = (time == null) ? null : DateTime(time.year, time.month, time.day); }); - } - - void changedEndDate(DateTime? time) { - setState(() { endDate = (time == null) ? null : DateTime(time.year, time.month, time.day); }); - } - void didTapResetTimeGridButton() { setState(() { startTime = -1;