/** * @return true if the supplied date is in the future else false */ fun isUpcoming(millis: Long): Boolean { return !isTomorrow(millis) && LocalDate(millis).isAfter(LocalDate.now()) } /** * @return true if the supplied date is tomorrow else false */ fun isTomorrow(millis: Long): Boolean { return LocalDate.now().plusDays(1).compareTo(LocalDate(millis)) == 0 } /** * @return true if the supplied date is today else false */ fun isToday(millis: Long): Boolean { return LocalDate.now().compareTo(LocalDate(millis)) == 0 } /** * @return true if the supplied when is yesterday else false */ fun isYesterday(millis: Long): Boolean { return LocalDate.now().minusDays(1).compareTo(LocalDate(millis)) == 0 } /** * @return true if the supplied when is this week else false */ fun isThisWeek(millis: Long): Boolean { return LocalDate.now().minusWeeks(1).compareTo(LocalDate(millis)) == 0 } /** * @return true if the supplied when is this month else false */ fun isThisMonth(millis: Long): Boolean { return LocalDate.now().minusMonths(1).compareTo(LocalDate(millis)) == 0 }