truncateFuture

inline fun Date?.truncateFuture(now: () -> Long = { System.currentTimeMillis() }): Date?

Truncates the date to the current time if it's in the future.