From ece1f2ed657cba987fc190061327994e6b384ff8 Mon Sep 17 00:00:00 2001 From: rapterjet2004 Date: Wed, 4 Sep 2024 07:15:34 -0500 Subject: [PATCH] fixed weekendTimeStamp, added a comment for clarity Signed-off-by: rapterjet2004 --- .../com/nextcloud/talk/ui/dialog/DateTimePickerFragment.kt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/nextcloud/talk/ui/dialog/DateTimePickerFragment.kt b/app/src/main/java/com/nextcloud/talk/ui/dialog/DateTimePickerFragment.kt index 48cbc44a4a..42f87f285e 100644 --- a/app/src/main/java/com/nextcloud/talk/ui/dialog/DateTimePickerFragment.kt +++ b/app/src/main/java/com/nextcloud/talk/ui/dialog/DateTimePickerFragment.kt @@ -102,13 +102,13 @@ class DateTimePickerFragment : DialogFragment() { tomorrowTimeStamp = getTimeFromCalendar( hour = HOUR_EIGHT_AM, minute = 0, - daysToAdd = 1, + daysToAdd = 1 ) binding.dateTimePickerWeekend.visibility = View.GONE // because today is the weekend } else { tomorrowTimeStamp = getTimeFromCalendar(hour = HOUR_EIGHT_AM, minute = 0, daysToAdd = 1) - weekendTimeStamp = getTimeFromCalendar(hour = HOUR_EIGHT_AM, day = Calendar.SATURDAY, minute = 0) + weekendTimeStamp = getTimeFromCalendar(hour = HOUR_EIGHT_AM, weekDay = Calendar.SATURDAY, minute = 0) } binding.dateTimePickerTomorrowTextview.text = getTimeFromTimeStamp(tomorrowTimeStamp) binding.dateTimePickerWeekendTextview.text = getTimeFromTimeStamp(weekendTimeStamp) @@ -249,6 +249,9 @@ class DateTimePickerFragment : DialogFragment() { timePicker.show(this.parentFragmentManager, TAG) } + /** + * You can use `weekDay` or `daysToAdd` or neither but don't use both b/c it messes up the calendar + */ @Suppress("LongParameterList") private fun getTimeFromCalendar( year: Int = Calendar.getInstance().get(Calendar.YEAR),