Skip to content

Commit

Permalink
Finally solved issue #1734
Browse files Browse the repository at this point in the history
  • Loading branch information
quadcopterman committed Feb 28, 2024
1 parent 4a2de85 commit d223859
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,9 @@ abstract class AbstractEventCreationFragment : Fragment() {
startDateEditText?.setText("")
startDate = null

if (compareWithNowByDay(newDate) < 0) {
// let the comparison go to -1 for cases where the time is just after midnight
// this is handled just fine by computeTimeInSeconds() as an Instant also contains the date
if (compareWithNowByDay(newDate) < -1) {
showToast(R.string.past_date_not_allowed)
return
}
Expand All @@ -219,7 +221,7 @@ abstract class AbstractEventCreationFragment : Fragment() {
endTimeEditText?.setText("")
}

if (compareWithNowByDay(newDate) == 0) {
if (compareWithNowByDay(newDate) <= 0) {
computeTimesInSeconds()
}
}
Expand Down Expand Up @@ -251,7 +253,6 @@ abstract class AbstractEventCreationFragment : Fragment() {
private fun onStartTime(bundle: Bundle) {
startTime = getSelection(bundle)
startTimeEditText?.setText(timeFormat.format(startTime!!.time))

if (startDate != null &&
endDate != null &&
startDate == endDate &&
Expand Down Expand Up @@ -319,7 +320,6 @@ abstract class AbstractEventCreationFragment : Fragment() {
if (startDate == null || startTime == null) {
return false
}

completeStartTime[
startDate!![Calendar.YEAR],
startDate!![Calendar.MONTH],
Expand Down

0 comments on commit d223859

Please sign in to comment.