I just started using the Joda time classes and noticed that there are 
methods 'isBefore' and 'isAfter'. It seems like it would be nice to 
include methods 'isOnOrBefore' and 'isOnOrAfter'.

I typically have written loop code as follows using our own date/time 
classes:

     LocalDate startDate = new LocalDate(1,1,2007);
     LocalDate endDate   = new LocalDate(1,15,2007);

     for (LocalDate date = startDate; date.isOnOrBefore(endDate); date = 
date.plusDays(1))
     {
        // do something
     }

This seems more readable then

     LocalDate startDate = new LocalDate(1,1,2007);
     LocalDate endDate   = new LocalDate(1,15,2007);

     for (LocalDate date = startDate; date.compareTo(endDate) <= 0; date 
= date.plusDays(1))
     {
        // do something
     }

P.S. I am willing to write the code and send it over.

Thanks for any help on this.

Jeff Stano

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Joda-interest mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/joda-interest

Reply via email to