What is the simplest way to use Joda time and get something like the following behavior:
public boolean check( DateTime checkTime )
{
DateTime someTime = new DateTime(); //set to "now" for sake of example
return checkTime.isBefore( someTime ) && checkTime.notMoreThanThreeHoursBefore( someTime );
}
So if someTime is set to 15:00 and checkTime is set to 12:15 it should return true.
If someTime is set to 15:00 and checkTime is set to 11:45 it should return false because checkTime is more than 3 hours before someTime.
If someTime is set to 15:00 and checkTime is set to 15:15 it should return false because checkTime is after someTime.
After some playing around, I found this which reads nicely: