unitsofmeasurement/uom-se — pull request #42 by otaviojava (2014-11-02 11:39:53+00:00)
Title: Time integration

Integration with TimeUnit and new Date API (JSR 310).
obs: The new DateApi already has integration with the old Date API (java.util.Date and java.util.Calender).

```
Quantity hour = Quantities.getQuantity(1, SI.HOUR);
TimeUnitQuantity hourTimeUnit = TimeUnitQuantity.of(hour);
TimeUnitQuantity day = TimeUnitQuantity.of(DAYS, 1);
Quantity dayQuantity = day.toQuantity();

LocalDate a = Year.of(2015).atMonth(Month.JANUARY).atDay(9);
LocalDate b = Year.of(2015).atMonth(Month.JANUARY).atDay(10);
Quantity time = TimeQuantities.of(a, b);//in days

LocalTime a = LocalTime.of(0, 0);
LocalTime b = LocalTime.of(12, 0);
Quantity time = TimeQuantities.of(a, b);//in hours

LocalDate date = Year.of(2015).atMonth(Month.JANUARY).atDay(9);
Quantity time = TimeQuantities.of(a, () -> TemporalAdjusters.next(DayOfWeek.SUNDAY));

LocalDate a = Year.of(2015).atMonth(Month.JANUARY).atDay(9);
Quantity time = TimeQuantities.of(a, () -> TemporalAdjusters.next(DayOfWeek.SUNDAY));

LocalTime a = LocalTime.MIDNIGHT;
TemporalAdjuster temporalAdjuster = (temporal) -> temporal.plus(12L , ChronoUnit.HOURS);
Quantity time = TimeQuantities.of(a, () -> temporalAdjuster);

```