polygene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nic...@apache.org
Subject [31/50] [abbrv] zest-qi4j git commit: Replaced Joda Time with Java 8 Time API.
Date Fri, 17 Apr 2015 16:08:43 GMT
http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/communication/web/booking/RoutePanel.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/communication/web/booking/RoutePanel.java b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/communication/web/booking/RoutePanel.java
index 5094ed7..1052770 100644
--- a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/communication/web/booking/RoutePanel.java
+++ b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/communication/web/booking/RoutePanel.java
@@ -77,11 +77,13 @@ public class RoutePanel extends Panel
             protected void populateItem( ListItem<Leg> item )
             {
                 Leg leg = item.getModelObject();
+                Date loadTime = new Date( leg.loadTime().get().toInstant().toEpochMilli() );
+                Date unloadTime = new Date( leg.unloadTime().get().toInstant().toEpochMilli() );
                 item.add( new Label( "voyage", leg.voyage().get().toString() ),
                           new Label( "loadLocation", leg.loadLocation().get().getCode() ),
-                          new Label( "loadTime", new Model<Date>( leg.loadTime().get() ) ),
+                          new Label( "loadTime", new Model<Date>( loadTime ) ),
                           new Label( "unloadLocation", leg.unloadLocation().get().getCode() ),
-                          new Label( "unloadTime", new Model<Date>( leg.unloadTime().get() ) )
+                          new Label( "unloadTime", new Model<Date>( unloadTime ) )
                 );
             }
         } );

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/communication/web/handling/IncidentLoggingApplicationMockupPage.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/communication/web/handling/IncidentLoggingApplicationMockupPage.java b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/communication/web/handling/IncidentLoggingApplicationMockupPage.java
index 57d1683..1e4b287 100644
--- a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/communication/web/handling/IncidentLoggingApplicationMockupPage.java
+++ b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/communication/web/handling/IncidentLoggingApplicationMockupPage.java
@@ -18,6 +18,10 @@
 package org.qi4j.sample.dcicargo.sample_b.communication.web.handling;
 
 import java.text.SimpleDateFormat;
+import java.time.LocalDate;
+import java.time.LocalTime;
+import java.time.ZoneOffset;
+import java.time.ZonedDateTime;
 import java.util.Date;
 import org.apache.wicket.ajax.AjaxRequestTarget;
 import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior;
@@ -30,8 +34,6 @@ import org.apache.wicket.model.Model;
 import org.apache.wicket.model.PropertyModel;
 import org.apache.wicket.model.StringResourceModel;
 import org.apache.wicket.util.value.ValueMap;
-import org.joda.time.DateTime;
-import org.joda.time.LocalDate;
 import org.qi4j.sample.dcicargo.sample_b.communication.query.CommonQueries;
 import org.qi4j.sample.dcicargo.sample_b.communication.query.HandlingQueries;
 import org.qi4j.sample.dcicargo.sample_b.communication.web.BasePage;
@@ -81,7 +83,7 @@ public class IncidentLoggingApplicationMockupPage extends BasePage
         FeedbackPanel feedback;
 
         // Form values
-        Date completion;
+        ZonedDateTime completion;
         String trackingId, unLocode, voyageNumber, eventType;
 
         // Input
@@ -100,7 +102,7 @@ public class IncidentLoggingApplicationMockupPage extends BasePage
             // Completion time
 
             final DateTextFieldWithPicker completionDateInput = new DateTextFieldWithPicker( "completion", "Completion", this );
-            completionDateInput.earliestDate( new LocalDate() );
+            completionDateInput.earliestDate( LocalDate.now() );
             add( completionDateInput.setLabel( Model.of( "Completion" ) ) );
 
             HandlingQueries fetch = new HandlingQueries();
@@ -198,7 +200,7 @@ public class IncidentLoggingApplicationMockupPage extends BasePage
 
                         // We simulate receiving raw text data from incident logging applications
                         // Add current time to date to have same-dates in processing order (would register full time in real app)
-                        Date adjustedCompletion = new Date( completion.getTime() + new DateTime().getMillisOfDay() );
+                        Date adjustedCompletion = new Date( completion.toInstant().toEpochMilli() );
                         String completionTimeString = new SimpleDateFormat( "yyyy-MM-dd HH:mm" ).format( adjustedCompletion );
 
                         // Parse "incoming" data (step 1 of ProcessHandlingEvent use case)

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/communication/web/tracking/HandlingHistoryPanel.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/communication/web/tracking/HandlingHistoryPanel.java b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/communication/web/tracking/HandlingHistoryPanel.java
index c07442b..8a3c699 100644
--- a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/communication/web/tracking/HandlingHistoryPanel.java
+++ b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/communication/web/tracking/HandlingHistoryPanel.java
@@ -65,7 +65,10 @@ public class HandlingHistoryPanel extends Panel
                 item.add( new WebMarkupContainer( "onTrackIcon" ).add( new AttributeAppender( "src", iconName, "" ) ) );
 
                 // Date
-                item.add( new Label( "completion", new Model<Date>( event.completionTime().get() ) ) );
+                item.add( new Label( "completion", new Model<Date>( new Date( event.completionTime()
+                                                                                  .get()
+                                                                                  .toInstant()
+                                                                                  .toEpochMilli() ) ) ) );
 
                 // Event description (data substitution in strings from HandlingHistoryPanel.properties)
                 ValueMap map = new ValueMap();

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/communication/web/tracking/TrackCargoPage.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/communication/web/tracking/TrackCargoPage.java b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/communication/web/tracking/TrackCargoPage.java
index 2161a9a..9e55cb3 100644
--- a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/communication/web/tracking/TrackCargoPage.java
+++ b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/communication/web/tracking/TrackCargoPage.java
@@ -18,7 +18,8 @@
 package org.qi4j.sample.dcicargo.sample_b.communication.web.tracking;
 
 import java.text.SimpleDateFormat;
-import java.util.Date;
+import java.time.LocalDate;
+import java.time.ZonedDateTime;
 import java.util.List;
 import org.apache.wicket.ajax.AjaxRequestTarget;
 import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior;
@@ -168,10 +169,9 @@ public class TrackCargoPage extends BasePage
 
                 // ETA ----------------------------------------------------------------------
                 String destination = cargo.routeSpecification().get().destination().get().getString();
-                Date eta = cargo.delivery().get().eta().get();
-                String etaString = eta == null ? "?" : new SimpleDateFormat( "yyyy-MM-dd" ).format( eta );
+                ZonedDateTime eta = cargo.delivery().get().eta().get();
                 add( new Label( "eta", new StringResourceModel(
-                    "eta", this, null, Model.of( destination ), Model.of( etaString ) ) ) );
+                    "eta", this, null, Model.of( destination ), Model.of( eta.toString() ) ) ) );
 
                 // Warning/Notifier ----------------------------------------------------------------------
                 add( new WebMarkupContainer( "isMisdirected" ).setVisible( cargo.delivery()

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/booking/BookNewCargo.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/booking/BookNewCargo.java b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/booking/BookNewCargo.java
index deed463..957888d 100644
--- a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/booking/BookNewCargo.java
+++ b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/booking/BookNewCargo.java
@@ -17,7 +17,9 @@
  */
 package org.qi4j.sample.dcicargo.sample_b.context.interaction.booking;
 
-import java.util.Date;
+import java.time.Instant;
+import java.time.LocalDate;
+import java.time.ZonedDateTime;
 import org.qi4j.api.common.Optional;
 import org.qi4j.api.injection.scope.Service;
 import org.qi4j.api.injection.scope.This;
@@ -55,9 +57,9 @@ public class BookNewCargo extends Context
 
     private Location origin;
     private Location destination;
-    private Date arrivalDeadline;
+    private ZonedDateTime arrivalDeadline;
 
-    public BookNewCargo( CargoFactory cargoFactory, Location origin, Location destination, Date arrivalDeadline )
+    public BookNewCargo( CargoFactory cargoFactory, Location origin, Location destination, ZonedDateTime arrivalDeadline )
         throws Exception
     {
         bookingSystem = rolePlayer( BookingSystemRole.class, cargoFactory );
@@ -66,7 +68,7 @@ public class BookNewCargo extends Context
         this.arrivalDeadline = arrivalDeadline;
     }
 
-    public BookNewCargo( String originId, String destinationId, Date deadline )
+    public BookNewCargo( String originId, String destinationId, ZonedDateTime deadline )
         throws Exception
     {
         this( loadEntity( CargoAggregateRoot.class, CargoAggregateRoot.CARGOS_ID ),
@@ -108,14 +110,14 @@ public class BookNewCargo extends Context
             public TrackingId createCargo( String trackingIdString )
                 throws Exception
             {
-                Date earliestDeparture = new Date();
+                ZonedDateTime earliestDeparture = ZonedDateTime.now();
                 RouteSpecification routeSpec = routeSpecFactory.build( c.origin,
                                                                        c.destination,
                                                                        earliestDeparture,
                                                                        c.arrivalDeadline );
 
                 ValueBuilder<Delivery> delivery = vbf.newValueBuilder( Delivery.class );
-                delivery.prototype().timestamp().set( new Date() );
+                delivery.prototype().timestamp().set( Instant.now() );
                 delivery.prototype().transportStatus().set( TransportStatus.NOT_RECEIVED );
                 delivery.prototype().routingStatus().set( RoutingStatus.NOT_ROUTED );
 

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/booking/routing/AssignCargoToRoute.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/booking/routing/AssignCargoToRoute.java b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/booking/routing/AssignCargoToRoute.java
index b656771..4c804fb 100644
--- a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/booking/routing/AssignCargoToRoute.java
+++ b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/booking/routing/AssignCargoToRoute.java
@@ -17,7 +17,9 @@
  */
 package org.qi4j.sample.dcicargo.sample_b.context.interaction.booking.routing;
 
-import java.util.Date;
+import java.time.Duration;
+import java.time.Instant;
+import java.time.ZonedDateTime;
 import org.qi4j.api.injection.scope.This;
 import org.qi4j.api.mixin.Mixins;
 import org.qi4j.api.value.ValueBuilder;
@@ -39,8 +41,12 @@ import org.qi4j.sample.dcicargo.sample_b.infrastructure.dci.Context;
 import org.qi4j.sample.dcicargo.sample_b.infrastructure.dci.RoleMixin;
 
 import static org.qi4j.sample.dcicargo.sample_b.data.structure.delivery.RoutingStatus.ROUTED;
-import static org.qi4j.sample.dcicargo.sample_b.data.structure.delivery.TransportStatus.*;
-import static org.qi4j.sample.dcicargo.sample_b.data.structure.handling.HandlingEventType.*;
+import static org.qi4j.sample.dcicargo.sample_b.data.structure.delivery.TransportStatus.CLAIMED;
+import static org.qi4j.sample.dcicargo.sample_b.data.structure.delivery.TransportStatus.NOT_RECEIVED;
+import static org.qi4j.sample.dcicargo.sample_b.data.structure.delivery.TransportStatus.ONBOARD_CARRIER;
+import static org.qi4j.sample.dcicargo.sample_b.data.structure.handling.HandlingEventType.LOAD;
+import static org.qi4j.sample.dcicargo.sample_b.data.structure.handling.HandlingEventType.RECEIVE;
+import static org.qi4j.sample.dcicargo.sample_b.data.structure.handling.HandlingEventType.UNLOAD;
 
 /**
  * Assign Cargo to Route (subfunction use case)
@@ -149,16 +155,12 @@ public class AssignCargoToRoute extends Context
                                                                                                .get() );
 
                     // Estimate carrier arrival time
-                    Date estimatedArrivalDate = carrierMovement.arrivalTime().get();
-                    if( c.lastHandlingEvent.completionTime().get().after( carrierMovement.departureTime().get() ) )
+                    ZonedDateTime estimatedArrivalDate = carrierMovement.arrivalTime().get();
+                    if( c.lastHandlingEvent.completionTime().get().isAfter( carrierMovement.departureTime().get() ) )
                     {
-                        long start = carrierMovement.departureTime().get().getTime();
-                        long end = carrierMovement.arrivalTime().get().getTime();
-                        long duration = end - start;
-                        estimatedArrivalDate = new Date( c.lastHandlingEvent
-                                                             .completionTime()
-                                                             .get()
-                                                             .getTime() + duration );
+                        Duration duration = Duration.between( carrierMovement.departureTime().get(),
+                                                              carrierMovement.arrivalTime().get() );
+                        estimatedArrivalDate = c.lastHandlingEvent.completionTime().get().plus(duration);
                     }
 
                     nextHandlingEvent.handlingEventType().set( UNLOAD );
@@ -179,7 +181,7 @@ public class AssignCargoToRoute extends Context
 
                 ValueBuilder<Delivery> deliveryBuilder = vbf.newValueBuilder( Delivery.class );
                 newDelivery = deliveryBuilder.prototype();
-                newDelivery.timestamp().set( new Date() );
+                newDelivery.timestamp().set( Instant.now() );
                 newDelivery.lastHandlingEvent().set( c.lastHandlingEvent );
                 newDelivery.transportStatus().set( c.transportStatus );
                 newDelivery.isUnloadedAtDestination().set( false );

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/booking/specification/DeriveUpdatedRouteSpecification.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/booking/specification/DeriveUpdatedRouteSpecification.java b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/booking/specification/DeriveUpdatedRouteSpecification.java
index 106ea51..01f72fd 100644
--- a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/booking/specification/DeriveUpdatedRouteSpecification.java
+++ b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/booking/specification/DeriveUpdatedRouteSpecification.java
@@ -17,7 +17,7 @@
  */
 package org.qi4j.sample.dcicargo.sample_b.context.interaction.booking.specification;
 
-import java.util.Date;
+import java.time.ZonedDateTime;
 import org.qi4j.api.injection.scope.Service;
 import org.qi4j.api.injection.scope.This;
 import org.qi4j.api.mixin.Mixins;
@@ -106,8 +106,8 @@ public class DeriveUpdatedRouteSpecification extends Context
 
             Location newOrigin;
             Location newDestination;
-            Date newEarliestDeparture;
-            Date newArrivalDeadline;
+            ZonedDateTime newEarliestDeparture;
+            ZonedDateTime newArrivalDeadline;
 
             public RouteSpecification getUpdatedRouteSpecification()
                 throws CannotCreateRouteSpecificationException, UnexpectedCarrierException

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/handling/inspection/event/InspectArrivedCargo.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/handling/inspection/event/InspectArrivedCargo.java b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/handling/inspection/event/InspectArrivedCargo.java
index 563d637..a0a2eb3 100644
--- a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/handling/inspection/event/InspectArrivedCargo.java
+++ b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/handling/inspection/event/InspectArrivedCargo.java
@@ -17,7 +17,7 @@
  */
 package org.qi4j.sample.dcicargo.sample_b.context.interaction.handling.inspection.event;
 
-import java.util.Date;
+import java.time.Instant;
 import org.qi4j.api.injection.scope.This;
 import org.qi4j.api.mixin.Mixins;
 import org.qi4j.api.value.ValueBuilder;
@@ -42,7 +42,6 @@ import static org.qi4j.sample.dcicargo.sample_b.data.structure.handling.Handling
 /**
  * Inspect Arrived Cargo (subfunction use case)
  *
- * This is one the variations of the {@link com.marcgrue.dcisample_b.context.interaction.handling.inspection.InspectCargoDeliveryStatus} use case.
  */
 public class InspectArrivedCargo extends Context
 {
@@ -110,7 +109,7 @@ public class InspectArrivedCargo extends Context
 
                 ValueBuilder<Delivery> newDeliveryBuilder = vbf.newValueBuilder( Delivery.class );
                 newDelivery = newDeliveryBuilder.prototype();
-                newDelivery.timestamp().set( new Date() );
+                newDelivery.timestamp().set( Instant.now() );
                 newDelivery.lastHandlingEvent().set( c.arrivalEvent );
                 newDelivery.transportStatus().set( IN_PORT );
 

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/handling/inspection/event/InspectCargoInCustoms.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/handling/inspection/event/InspectCargoInCustoms.java b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/handling/inspection/event/InspectCargoInCustoms.java
index 8b67067..3393223 100644
--- a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/handling/inspection/event/InspectCargoInCustoms.java
+++ b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/handling/inspection/event/InspectCargoInCustoms.java
@@ -17,7 +17,7 @@
  */
 package org.qi4j.sample.dcicargo.sample_b.context.interaction.handling.inspection.event;
 
-import java.util.Date;
+import java.time.Instant;
 import org.qi4j.api.injection.scope.This;
 import org.qi4j.api.mixin.Mixins;
 import org.qi4j.api.value.ValueBuilder;
@@ -41,7 +41,6 @@ import static org.qi4j.sample.dcicargo.sample_b.data.structure.handling.Handling
 /**
  * Inspect Cargo In Customs (subfunction use case)
  *
- * This is one the variations of the {@link com.marcgrue.dcisample_b.context.interaction.handling.inspection.InspectCargoDeliveryStatus} use case.
  *
  * Can the cargo get handled by customs only in the current port location?! Nothing now prevents
  * an unexpected cargo in customs in some random location. A domain expert is needed to explain
@@ -117,7 +116,7 @@ public class InspectCargoInCustoms extends Context
 
                 ValueBuilder<Delivery> newDeliveryBuilder = vbf.newValueBuilder( Delivery.class );
                 newDelivery = newDeliveryBuilder.prototype();
-                newDelivery.timestamp().set( new Date() );
+                newDelivery.timestamp().set( Instant.now() );
                 newDelivery.lastHandlingEvent().set( c.customsEvent );
                 newDelivery.transportStatus().set( IN_PORT );
                 newDelivery.isUnloadedAtDestination().set( false );

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/handling/inspection/event/InspectClaimedCargo.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/handling/inspection/event/InspectClaimedCargo.java b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/handling/inspection/event/InspectClaimedCargo.java
index 110a441..bff45d6 100644
--- a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/handling/inspection/event/InspectClaimedCargo.java
+++ b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/handling/inspection/event/InspectClaimedCargo.java
@@ -17,7 +17,7 @@
  */
 package org.qi4j.sample.dcicargo.sample_b.context.interaction.handling.inspection.event;
 
-import java.util.Date;
+import java.time.Instant;
 import org.qi4j.api.injection.scope.This;
 import org.qi4j.api.mixin.Mixins;
 import org.qi4j.api.value.ValueBuilder;
@@ -39,8 +39,6 @@ import static org.qi4j.sample.dcicargo.sample_b.data.structure.handling.Handling
 /**
  * Inspect Claimed Cargo (subfunction use case)
  *
- * This is one the variations of the {@link com.marcgrue.dcisample_b.context.interaction.handling.inspection.InspectCargoDeliveryStatus} use case.
- *
  * NOTE: We don't throw any misrouted/misdirected exceptions even though the cargo might not have
  * followed the original itinerary. The cargo has been delivered at destination and claimed by
  * Cargo Owner, so we're happy no matter how it got there.
@@ -106,7 +104,7 @@ public class InspectClaimedCargo extends Context
 
                 ValueBuilder<Delivery> newDeliveryBuilder = vbf.newValueBuilder( Delivery.class );
                 newDelivery = newDeliveryBuilder.prototype();
-                newDelivery.timestamp().set( new Date() );
+                newDelivery.timestamp().set( Instant.now() );
                 newDelivery.lastHandlingEvent().set( c.claimEvent );
                 newDelivery.transportStatus().set( CLAIMED );
                 newDelivery.isUnloadedAtDestination().set( false ); // Why not true if claimed in final destination?

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/handling/inspection/event/InspectLoadedCargo.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/handling/inspection/event/InspectLoadedCargo.java b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/handling/inspection/event/InspectLoadedCargo.java
index 0625040..3ae1f99 100644
--- a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/handling/inspection/event/InspectLoadedCargo.java
+++ b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/handling/inspection/event/InspectLoadedCargo.java
@@ -17,7 +17,9 @@
  */
 package org.qi4j.sample.dcicargo.sample_b.context.interaction.handling.inspection.event;
 
-import java.util.Date;
+import java.time.Duration;
+import java.time.Instant;
+import java.time.ZonedDateTime;
 import java.util.Random;
 import org.qi4j.api.injection.scope.This;
 import org.qi4j.api.mixin.Mixins;
@@ -102,7 +104,7 @@ public class InspectLoadedCargo extends Context
         deliveryInspector.inspectLoadedCargo();
     }
 
-    @Mixins( DeliveryInspectorRole.Mixin.class )
+    @Mixins(DeliveryInspectorRole.Mixin.class)
     public interface DeliveryInspectorRole
     {
         void setContext( InspectLoadedCargo context );
@@ -124,7 +126,7 @@ public class InspectLoadedCargo extends Context
 
                 ValueBuilder<Delivery> newDeliveryBuilder = vbf.newValueBuilder( Delivery.class );
                 newDelivery = newDeliveryBuilder.prototype();
-                newDelivery.timestamp().set( new Date() );
+                newDelivery.timestamp().set( Instant.now() );
                 newDelivery.lastHandlingEvent().set( c.loadEvent );
                 newDelivery.transportStatus().set( ONBOARD_CARRIER );
                 newDelivery.isUnloadedAtDestination().set( false );
@@ -144,13 +146,12 @@ public class InspectLoadedCargo extends Context
                 }
 
                 // Estimate carrier arrival time
-                Date estimatedArrivalDate = carrierMovement.arrivalTime().get();
-                if( c.loadEvent.completionTime().get().after( carrierMovement.departureTime().get() ) )
+                ZonedDateTime estimatedArrivalDate = carrierMovement.arrivalTime().get();
+                if( c.loadEvent.completionTime().get().isAfter( carrierMovement.departureTime().get() ) )
                 {
-                    long start = carrierMovement.departureTime().get().getTime();
-                    long end = carrierMovement.arrivalTime().get().getTime();
-                    long duration = end - start;
-                    estimatedArrivalDate = new Date( c.loadEvent.completionTime().get().getTime() + duration );
+                    Duration duration = Duration.between( carrierMovement.departureTime().get(),
+                                                          carrierMovement.arrivalTime().get() );
+                    estimatedArrivalDate = c.loadEvent.completionTime().get().plus(duration);
                     // ... We could notify cargo owner if we already now know that we will miss the next ship
                 }
 

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/handling/inspection/event/InspectReceivedCargo.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/handling/inspection/event/InspectReceivedCargo.java b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/handling/inspection/event/InspectReceivedCargo.java
index 3caa509..f9f2578 100644
--- a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/handling/inspection/event/InspectReceivedCargo.java
+++ b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/handling/inspection/event/InspectReceivedCargo.java
@@ -17,7 +17,7 @@
  */
 package org.qi4j.sample.dcicargo.sample_b.context.interaction.handling.inspection.event;
 
-import java.util.Date;
+import java.time.Instant;
 import org.qi4j.api.injection.scope.This;
 import org.qi4j.api.mixin.Mixins;
 import org.qi4j.api.value.ValueBuilder;
@@ -44,8 +44,6 @@ import static org.qi4j.sample.dcicargo.sample_b.data.structure.handling.Handling
 /**
  * Inspect Received Cargo (subfunction use case)
  *
- * This is one the variations of the {@link com.marcgrue.dcisample_b.context.interaction.handling.inspection.InspectCargoDeliveryStatus} use case.
- *
  * Note that we consider the cargo still on track if it's received in cargo origin regardless of routing status!
  */
 public class InspectReceivedCargo extends Context
@@ -121,7 +119,7 @@ public class InspectReceivedCargo extends Context
 
                 ValueBuilder<Delivery> newDeliveryBuilder = vbf.newValueBuilder( Delivery.class );
                 newDelivery = newDeliveryBuilder.prototype();
-                newDelivery.timestamp().set( new Date() );
+                newDelivery.timestamp().set( Instant.now() );
                 newDelivery.lastHandlingEvent().set( c.receiveEvent );
                 newDelivery.transportStatus().set( IN_PORT );
                 newDelivery.isUnloadedAtDestination().set( false );

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/handling/inspection/event/InspectUnhandledCargo.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/handling/inspection/event/InspectUnhandledCargo.java b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/handling/inspection/event/InspectUnhandledCargo.java
index 476586c..894f799 100644
--- a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/handling/inspection/event/InspectUnhandledCargo.java
+++ b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/handling/inspection/event/InspectUnhandledCargo.java
@@ -17,7 +17,7 @@
  */
 package org.qi4j.sample.dcicargo.sample_b.context.interaction.handling.inspection.event;
 
-import java.util.Date;
+import java.time.Instant;
 import org.qi4j.api.injection.scope.This;
 import org.qi4j.api.mixin.Mixins;
 import org.qi4j.api.value.ValueBuilder;
@@ -39,8 +39,6 @@ import static org.qi4j.sample.dcicargo.sample_b.data.structure.handling.Handling
 /**
  * Inspect Unhandled Cargo (subfunction use case)
  *
- * This is one the variations of the {@link com.marcgrue.dcisample_b.context.interaction.handling.inspection.InspectCargoDeliveryStatus} use case.
- *
  * Here we can check a cargo that hasn't been received in origin yet.
  */
 public class InspectUnhandledCargo extends Context
@@ -98,7 +96,7 @@ public class InspectUnhandledCargo extends Context
 
                 ValueBuilder<Delivery> newDeliveryBuilder = vbf.newValueBuilder( Delivery.class );
                 newDelivery = newDeliveryBuilder.prototype();
-                newDelivery.timestamp().set( new Date() );
+                newDelivery.timestamp().set( Instant.now() );
                 newDelivery.lastHandlingEvent().set( null );
                 newDelivery.transportStatus().set( NOT_RECEIVED );
                 newDelivery.isUnloadedAtDestination().set( false );

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/handling/inspection/event/InspectUnloadedCargo.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/handling/inspection/event/InspectUnloadedCargo.java b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/handling/inspection/event/InspectUnloadedCargo.java
index fe64e12..a61d84d 100644
--- a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/handling/inspection/event/InspectUnloadedCargo.java
+++ b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/handling/inspection/event/InspectUnloadedCargo.java
@@ -17,7 +17,7 @@
  */
 package org.qi4j.sample.dcicargo.sample_b.context.interaction.handling.inspection.event;
 
-import java.util.Date;
+import java.time.Instant;
 import org.qi4j.api.injection.scope.This;
 import org.qi4j.api.mixin.Mixins;
 import org.qi4j.api.value.ValueBuilder;
@@ -46,7 +46,6 @@ import static org.qi4j.sample.dcicargo.sample_b.data.structure.handling.Handling
 /**
  * Inspect Unloaded Cargo (subfunction use case)
  *
- * This is one the variations of the {@link com.marcgrue.dcisample_b.context.interaction.handling.inspection.InspectCargoDeliveryStatus} use case.
  */
 public class InspectUnloadedCargo extends Context
 {
@@ -117,7 +116,7 @@ public class InspectUnloadedCargo extends Context
 
                 ValueBuilder<Delivery> newDeliveryBuilder = vbf.newValueBuilder( Delivery.class );
                 newDelivery = newDeliveryBuilder.prototype();
-                newDelivery.timestamp().set( new Date() );
+                newDelivery.timestamp().set( Instant.now() );
                 newDelivery.lastHandlingEvent().set( c.unloadEvent );
                 newDelivery.transportStatus().set( IN_PORT );
                 newDelivery.isUnloadedAtDestination().set( false );

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/handling/parsing/ParseHandlingEventData.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/handling/parsing/ParseHandlingEventData.java b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/handling/parsing/ParseHandlingEventData.java
index 21d6fef..db5312c 100644
--- a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/handling/parsing/ParseHandlingEventData.java
+++ b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/handling/parsing/ParseHandlingEventData.java
@@ -17,9 +17,8 @@
  */
 package org.qi4j.sample.dcicargo.sample_b.context.interaction.handling.parsing;
 
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.Date;
+import java.time.ZonedDateTime;
+import java.time.format.DateTimeParseException;
 import org.qi4j.api.common.Optional;
 import org.qi4j.api.injection.scope.Structure;
 import org.qi4j.api.mixin.Mixins;
@@ -45,7 +44,7 @@ import org.qi4j.sample.dcicargo.sample_b.data.structure.handling.HandlingEventTy
  * a file upload solution like UploadDirectoryScanner in the DDD sample - or some other
  * technical solution.
  */
-@Mixins( ParseHandlingEventData.Mixin.class )
+@Mixins(ParseHandlingEventData.Mixin.class)
 public interface ParseHandlingEventData
     extends ServiceComposite
 {
@@ -66,9 +65,7 @@ public interface ParseHandlingEventData
         @Structure
         ValueBuilderFactory vbf;
 
-        static final String ISO_8601_FORMAT = "yyyy-MM-dd HH:mm";
-
-        Date completionTime;
+        ZonedDateTime completionTime;
         HandlingEventType handlingEventType;
 
         public ParsedHandlingEventData parse( String completionStr,
@@ -83,17 +80,12 @@ public interface ParseHandlingEventData
 
             try
             {
-                completionTime = new SimpleDateFormat( ISO_8601_FORMAT ).parse( completionStr.trim() );
+                completionTime = ZonedDateTime.parse( completionStr.trim() );
+                handlingEventType = HandlingEventType.valueOf( handlingEventTypeStr.trim() );
             }
-            catch( ParseException e )
+            catch( DateTimeParseException e )
             {
-                throw new InvalidHandlingEventDataException(
-                    "Invalid date format: '" + completionStr + "' must be on ISO 8601 format " + ISO_8601_FORMAT );
-            }
-
-            try
-            {
-                handlingEventType = HandlingEventType.valueOf( handlingEventTypeStr.trim() );
+                throw new InvalidHandlingEventDataException( "Invalid date format: '" + completionStr + "' must be on ISO 8601 format yyyy-MM-dd HH:mm" );
             }
             catch( Exception e )
             {
@@ -103,7 +95,7 @@ public interface ParseHandlingEventData
             // Step 4 - Collect parsed handling event data
 
             ValueBuilder<ParsedHandlingEventData> parsedData = vbf.newValueBuilder( ParsedHandlingEventData.class );
-            parsedData.prototype().registrationTime().set( new Date() );
+            parsedData.prototype().registrationTime().set( ZonedDateTime.now() );
             parsedData.prototype().completionTime().set( completionTime );
             parsedData.prototype().trackingIdString().set( trackingIdStr );
             parsedData.prototype().handlingEventType().set( handlingEventType );

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/handling/parsing/dto/ParsedHandlingEventData.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/handling/parsing/dto/ParsedHandlingEventData.java b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/handling/parsing/dto/ParsedHandlingEventData.java
index 19a8410..9f22bbd 100644
--- a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/handling/parsing/dto/ParsedHandlingEventData.java
+++ b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/handling/parsing/dto/ParsedHandlingEventData.java
@@ -18,7 +18,7 @@
 package org.qi4j.sample.dcicargo.sample_b.context.interaction.handling.parsing.dto;
 
 import java.text.SimpleDateFormat;
-import java.util.Date;
+import java.time.ZonedDateTime;
 import org.qi4j.api.common.Optional;
 import org.qi4j.api.mixin.Mixins;
 import org.qi4j.api.property.Immutable;
@@ -33,9 +33,9 @@ import org.qi4j.sample.dcicargo.sample_b.infrastructure.conversion.DTO;
 @Mixins( ParsedHandlingEventData.Mixin.class )
 public interface ParsedHandlingEventData extends DTO
 {
-    Property<Date> registrationTime();
+    Property<ZonedDateTime> registrationTime();
 
-    Property<Date> completionTime();
+    Property<ZonedDateTime> completionTime();
 
     Property<String> trackingIdString();
 

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/handling/registration/exception/CannotRegisterHandlingEventException.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/handling/registration/exception/CannotRegisterHandlingEventException.java b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/handling/registration/exception/CannotRegisterHandlingEventException.java
index ea3692a..8f52055 100644
--- a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/handling/registration/exception/CannotRegisterHandlingEventException.java
+++ b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/handling/registration/exception/CannotRegisterHandlingEventException.java
@@ -17,8 +17,6 @@
  */
 package org.qi4j.sample.dcicargo.sample_b.context.interaction.handling.registration.exception;
 
-import java.text.SimpleDateFormat;
-import java.util.Date;
 import org.qi4j.sample.dcicargo.sample_b.context.interaction.handling.parsing.dto.ParsedHandlingEventData;
 import org.qi4j.sample.dcicargo.sample_b.data.structure.handling.HandlingEvent;
 
@@ -41,7 +39,7 @@ public class CannotRegisterHandlingEventException extends Exception
         super();
         this.parsedHandlingEventData = parsedHandlingEventData;
 
-        time = parseDate( parsedHandlingEventData.completionTime().get() );
+        time = parsedHandlingEventData.completionTime().get().toString();
         id = parse( parsedHandlingEventData.trackingIdString().get() );
         type = parse( parsedHandlingEventData.handlingEventType().get().name() );
         unloc = parse( parsedHandlingEventData.unLocodeString().get() );
@@ -57,9 +55,4 @@ public class CannotRegisterHandlingEventException extends Exception
     {
         return str == null ? "null" : str;
     }
-
-    private String parseDate( Date date )
-    {
-        return date == null ? "null" : new SimpleDateFormat( "yyyy-MM-dd HH:mm:ss" ).format( date );
-    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/handling/registration/exception/ChronologicalException.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/handling/registration/exception/ChronologicalException.java b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/handling/registration/exception/ChronologicalException.java
index 94a0371..b40ff6c 100644
--- a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/handling/registration/exception/ChronologicalException.java
+++ b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/handling/registration/exception/ChronologicalException.java
@@ -17,7 +17,7 @@
  */
 package org.qi4j.sample.dcicargo.sample_b.context.interaction.handling.registration.exception;
 
-import java.util.Date;
+import java.time.ZonedDateTime;
 import org.qi4j.sample.dcicargo.sample_b.context.interaction.handling.parsing.dto.ParsedHandlingEventData;
 
 /**
@@ -25,9 +25,9 @@ import org.qi4j.sample.dcicargo.sample_b.context.interaction.handling.parsing.dt
  */
 public final class ChronologicalException extends CannotRegisterHandlingEventException
 {
-    Date lastCompletionTime;
+    ZonedDateTime lastCompletionTime;
 
-    public ChronologicalException( ParsedHandlingEventData parsedHandlingEventData, Date lastCompletionTime )
+    public ChronologicalException( ParsedHandlingEventData parsedHandlingEventData, ZonedDateTime lastCompletionTime )
     {
         super( parsedHandlingEventData );
         this.lastCompletionTime = lastCompletionTime;

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/service/routing/RoutingService.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/service/routing/RoutingService.java b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/service/routing/RoutingService.java
index 9296df2..0459c0b 100644
--- a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/service/routing/RoutingService.java
+++ b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/service/routing/RoutingService.java
@@ -18,11 +18,11 @@
 package org.qi4j.sample.dcicargo.sample_b.context.service.routing;
 
 import java.rmi.RemoteException;
+import java.time.LocalDate;
+import java.time.ZonedDateTime;
 import java.util.ArrayList;
 import java.util.Collections;
-import java.util.Date;
 import java.util.List;
-import org.joda.time.LocalDate;
 import org.qi4j.api.injection.scope.Service;
 import org.qi4j.api.injection.scope.Structure;
 import org.qi4j.api.mixin.Mixins;
@@ -78,7 +78,7 @@ public interface RoutingService
         public List<Itinerary> fetchRoutesForSpecification( RouteSpecification routeSpecification )
             throws FoundNoRoutesException
         {
-            final Date departureDate = routeSpecification.earliestDeparture().get();
+            final ZonedDateTime departureDate = routeSpecification.earliestDeparture().get();
             final Location origin = routeSpecification.origin().get();
             final Location destination = routeSpecification.destination().get();
 
@@ -111,7 +111,7 @@ public interface RoutingService
             if( itineraries.size() == 0 )
             {
                 throw new FoundNoRoutesException( destination.name().get(),
-                                                  new LocalDate( routeSpecification.arrivalDeadline().get() ) );
+                                                  routeSpecification.arrivalDeadline().get() );
             }
 
             return itineraries;

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/service/routing/exception/FoundNoRoutesException.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/service/routing/exception/FoundNoRoutesException.java b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/service/routing/exception/FoundNoRoutesException.java
index 1808a7d..07dba5d 100644
--- a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/service/routing/exception/FoundNoRoutesException.java
+++ b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/service/routing/exception/FoundNoRoutesException.java
@@ -17,7 +17,8 @@
  */
 package org.qi4j.sample.dcicargo.sample_b.context.service.routing.exception;
 
-import org.joda.time.LocalDate;
+import java.time.LocalDate;
+import java.time.ZonedDateTime;
 
 /**
  * Custom messages when the arrival deadline is too close and we can't find a route.
@@ -25,9 +26,9 @@ import org.joda.time.LocalDate;
 public class FoundNoRoutesException extends Exception
 {
     private final String city;
-    private final LocalDate deadline;
+    private final ZonedDateTime deadline;
 
-    public FoundNoRoutesException( String city, LocalDate deadline )
+    public FoundNoRoutesException( String city, ZonedDateTime deadline )
     {
         this.city = city;
         this.deadline = deadline;
@@ -36,17 +37,17 @@ public class FoundNoRoutesException extends Exception
     @Override
     public String getMessage()
     {
-        if( deadline.isBefore( new LocalDate().plusDays( 2 ) ) )
+        if( deadline.isBefore( ZonedDateTime.now().plusDays( 2 ) ) )
         {
             return "Impossible to get the cargo to " + city + " before " + deadline
                    + "! Make a new booking with a deadline 2-3 weeks ahead in time.";
         }
-        else if( deadline.isBefore( new LocalDate().plusDays( 4 ) ) )
+        else if( deadline.isBefore( ZonedDateTime.now().plusDays( 4 ) ) )
         {
             return "Couldn't find any routes arriving in " + city + " before " + deadline
                    + ". Please try again or make a new booking with a deadline 2-3 weeks ahead in time.";
         }
-        else if( deadline.isBefore( new LocalDate().plusDays( 6 ) ) )
+        else if( deadline.isBefore( ZonedDateTime.now().plusDays( 6 ) ) )
         {
             return "Sorry, our system couldn't immediately find a route arriving in " + city + " before " + deadline
                    + ". Please try again, and we should hopefully be able to find a new route for you.";

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/data/factory/HandlingEventFactory.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/data/factory/HandlingEventFactory.java b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/data/factory/HandlingEventFactory.java
index 297ea00..3eef494 100644
--- a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/data/factory/HandlingEventFactory.java
+++ b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/data/factory/HandlingEventFactory.java
@@ -17,7 +17,7 @@
  */
 package org.qi4j.sample.dcicargo.sample_b.data.factory;
 
-import java.util.Date;
+import java.time.ZonedDateTime;
 import org.qi4j.api.common.Optional;
 import org.qi4j.api.entity.EntityBuilder;
 import org.qi4j.api.injection.scope.Structure;
@@ -44,8 +44,8 @@ import org.qi4j.sample.dcicargo.sample_b.data.structure.voyage.Voyage;
 @Mixins( HandlingEventFactory.Mixin.class )
 public interface HandlingEventFactory
 {
-    HandlingEvent createHandlingEvent( Date registrationTime,
-                                       Date completionTime,
+    HandlingEvent createHandlingEvent( ZonedDateTime registrationTime,
+                                       ZonedDateTime completionTime,
                                        TrackingId trackingId,
                                        HandlingEventType handlingEventType,
                                        Location location,
@@ -59,8 +59,8 @@ public interface HandlingEventFactory
         @Structure
         UnitOfWorkFactory uowf;
 
-        public HandlingEvent createHandlingEvent( Date registrationTime,
-                                                  Date completionTime,
+        public HandlingEvent createHandlingEvent( ZonedDateTime registrationTime,
+                                                  ZonedDateTime completionTime,
                                                   TrackingId trackingId,
                                                   HandlingEventType handlingEventType,
                                                   Location location,

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/data/factory/RouteSpecificationFactoryService.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/data/factory/RouteSpecificationFactoryService.java b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/data/factory/RouteSpecificationFactoryService.java
index 0fe9143..ec7bce3 100644
--- a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/data/factory/RouteSpecificationFactoryService.java
+++ b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/data/factory/RouteSpecificationFactoryService.java
@@ -17,8 +17,7 @@
  */
 package org.qi4j.sample.dcicargo.sample_b.data.factory;
 
-import java.util.Date;
-import org.joda.time.DateMidnight;
+import java.time.ZonedDateTime;
 import org.qi4j.api.injection.scope.Structure;
 import org.qi4j.api.mixin.Mixins;
 import org.qi4j.api.service.ServiceComposite;
@@ -42,7 +41,7 @@ import org.qi4j.sample.dcicargo.sample_b.data.structure.location.Location;
 public interface RouteSpecificationFactoryService
     extends ServiceComposite
 {
-    RouteSpecification build( Location origin, Location destination, Date earliestDeparture, Date deadline )
+    RouteSpecification build( Location origin, Location destination, ZonedDateTime earliestDeparture, ZonedDateTime deadline )
         throws CannotCreateRouteSpecificationException;
 
     abstract class Mixin
@@ -51,7 +50,7 @@ public interface RouteSpecificationFactoryService
         @Structure
         ValueBuilderFactory vbf;
 
-        public RouteSpecification build( Location origin, Location destination, Date earliestDeparture, Date deadline )
+        public RouteSpecification build( Location origin, Location destination, ZonedDateTime earliestDeparture, ZonedDateTime deadline )
             throws CannotCreateRouteSpecificationException
         {
             if( origin == destination )
@@ -59,15 +58,12 @@ public interface RouteSpecificationFactoryService
                 throw new CannotCreateRouteSpecificationException( "Origin location can't be same as destination location." );
             }
 
-            Date endOfToday = new DateMidnight().plusDays( 1 ).toDate();
-            if( deadline.before( endOfToday ) )
+            if( deadline.isBefore( ZonedDateTime.now() ) )
             {
-                throw new CannotCreateRouteSpecificationException( "Arrival deadline is in the past or Today." +
-                                                                   "\nDeadline           " + deadline +
-                                                                   "\nToday (midnight)   " + endOfToday );
+                throw new CannotCreateRouteSpecificationException( "Arrival deadline is in the past or Today: " + deadline );
             }
 
-            if( deadline.before( earliestDeparture ) )
+            if( deadline.isBefore( earliestDeparture ) )
             {
                 throw new CannotCreateRouteSpecificationException( "Deadline can't be before departure:" +
                                                                    "\nDeparture   " + earliestDeparture +

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/data/structure/cargo/RouteSpecification.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/data/structure/cargo/RouteSpecification.java b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/data/structure/cargo/RouteSpecification.java
index cc72b5d..b5c5951 100644
--- a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/data/structure/cargo/RouteSpecification.java
+++ b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/data/structure/cargo/RouteSpecification.java
@@ -17,8 +17,7 @@
  */
 package org.qi4j.sample.dcicargo.sample_b.data.structure.cargo;
 
-import java.text.SimpleDateFormat;
-import java.util.Date;
+import java.time.ZonedDateTime;
 import org.qi4j.api.association.Association;
 import org.qi4j.api.mixin.Mixins;
 import org.qi4j.api.property.Property;
@@ -50,7 +49,7 @@ import org.qi4j.sample.dcicargo.sample_b.data.structure.location.Location;
  *
  * All properties are mandatory and immutable.
  */
-@Mixins( RouteSpecification.Mixin.class )
+@Mixins(RouteSpecification.Mixin.class)
 public interface RouteSpecification
     extends ValueComposite
 {
@@ -58,9 +57,9 @@ public interface RouteSpecification
 
     Association<Location> destination();
 
-    Property<Date> earliestDeparture();
+    Property<ZonedDateTime> earliestDeparture();
 
-    Property<Date> arrivalDeadline();
+    Property<ZonedDateTime> arrivalDeadline();
 
     // Side-effects free and UI agnostic convenience methods
     boolean isSatisfiedBy( Itinerary itinerary );
@@ -75,24 +74,21 @@ public interface RouteSpecification
             return itinerary != null &&
                    !itinerary.legs().get().isEmpty() &&
                    origin().get().equals( itinerary.firstLeg().loadLocation().get() ) &&
-                   earliestDeparture().get().before( itinerary.firstLeg().loadTime().get() ) &&
+                   earliestDeparture().get().isBefore( itinerary.firstLeg().loadTime().get() ) &&
                    destination().get().equals( itinerary.lastLeg().unloadLocation().get() ) &&
-                   arrivalDeadline().get().after( itinerary.eta() );
+                   arrivalDeadline().get().isAfter( itinerary.eta() );
         }
 
         public String print()
         {
-            StringBuilder sb = new StringBuilder(
-                "\nROUTE SPECIFICATION ------------" ).
-                append( "\n  Origin               " ).append( origin().get() ).
-                append( "\n  Destination          " ).append( destination().get() ).
-                append( "\n  Earliest departure   " )
-                .append( new SimpleDateFormat( "yyyy-MM-dd" ).format( earliestDeparture().get() ) )
-                .
-                    append( "\n  Arrival deadline     " )
-                .append( new SimpleDateFormat( "yyyy-MM-dd" ).format( arrivalDeadline().get() ) )
-                .
-                    append( "\n--------------------------------" );
+            StringBuilder sb = new StringBuilder( "\nROUTE SPECIFICATION ------------" )
+                .append( "\n  Origin               " ).append( origin().get() )
+                .append( "\n  Destination          " ).append( destination().get() )
+                .append( "\n  Earliest departure   " )
+                .append( earliestDeparture().get().toLocalDate() )
+                .append( "\n  Arrival deadline     " )
+                .append( arrivalDeadline().get().toLocalDate() )
+                .append( "\n--------------------------------" );
             return sb.toString();
         }
     }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/data/structure/delivery/Delivery.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/data/structure/delivery/Delivery.java b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/data/structure/delivery/Delivery.java
index 5c13f48..48ab2a4 100644
--- a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/data/structure/delivery/Delivery.java
+++ b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/data/structure/delivery/Delivery.java
@@ -17,7 +17,8 @@
  */
 package org.qi4j.sample.dcicargo.sample_b.data.structure.delivery;
 
-import java.util.Date;
+import java.time.Instant;
+import java.time.ZonedDateTime;
 import org.qi4j.api.association.Association;
 import org.qi4j.api.common.Optional;
 import org.qi4j.api.common.UseDefaults;
@@ -91,7 +92,7 @@ import org.qi4j.sample.dcicargo.sample_b.data.structure.itinerary.Itinerary;
 public interface Delivery
     extends ValueComposite
 {
-    Property<Date> timestamp();
+    Property<Instant> timestamp();
 
     /* (types:)
      * RECEIVE
@@ -126,7 +127,7 @@ public interface Delivery
     Property<Boolean> isMisdirected();
 
     @Optional
-    Property<Date> eta();
+    Property<ZonedDateTime> eta();
 
     // Index of earliest uncompleted Itinerary Leg - bumped up after each unload (except at destination)
     @UseDefaults

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/data/structure/delivery/NextHandlingEvent.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/data/structure/delivery/NextHandlingEvent.java b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/data/structure/delivery/NextHandlingEvent.java
index 72da122..9a90a23 100644
--- a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/data/structure/delivery/NextHandlingEvent.java
+++ b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/data/structure/delivery/NextHandlingEvent.java
@@ -17,7 +17,7 @@
  */
 package org.qi4j.sample.dcicargo.sample_b.data.structure.delivery;
 
-import java.util.Date;
+import java.time.ZonedDateTime;
 import org.qi4j.api.association.Association;
 import org.qi4j.api.common.Optional;
 import org.qi4j.api.property.Property;
@@ -47,7 +47,7 @@ public interface NextHandlingEvent
     Association<Location> location();
 
     @Optional
-    Property<Date> time();
+    Property<ZonedDateTime> time();
 
     @Optional
     Association<Voyage> voyage();

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/data/structure/handling/HandlingEvent.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/data/structure/handling/HandlingEvent.java b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/data/structure/handling/HandlingEvent.java
index b4b33c8..0e8014d 100644
--- a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/data/structure/handling/HandlingEvent.java
+++ b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/data/structure/handling/HandlingEvent.java
@@ -17,8 +17,7 @@
  */
 package org.qi4j.sample.dcicargo.sample_b.data.structure.handling;
 
-import java.text.SimpleDateFormat;
-import java.util.Date;
+import java.time.ZonedDateTime;
 import org.qi4j.api.association.Association;
 import org.qi4j.api.common.Optional;
 import org.qi4j.api.mixin.Mixins;
@@ -52,12 +51,12 @@ import org.qi4j.sample.dcicargo.sample_b.data.structure.voyage.Voyage;
  * {@link HandlingEventType#CLAIM} or {@link HandlingEventType#CUSTOMS}.
  */
 @Immutable
-@Mixins( HandlingEvent.Mixin.class )
+@Mixins(HandlingEvent.Mixin.class)
 public interface HandlingEvent
 {
-    Property<Date> registrationTime();
+    Property<ZonedDateTime> registrationTime();
 
-    Property<Date> completionTime();
+    Property<ZonedDateTime> completionTime();
 
     Property<TrackingId> trackingId();
 
@@ -81,14 +80,12 @@ public interface HandlingEvent
                 voyage = voyage().get().voyageNumber().get().number().get();
             }
 
-            SimpleDateFormat date = new SimpleDateFormat( "yyyy-MM-dd" );
-
             StringBuilder builder = new StringBuilder( "\nHANDLING EVENT -----------------" ).
                 append( "\n  Cargo       " ).append( trackingId().get().id().get() ).
                 append( "\n  Type        " ).append( handlingEventType().get().name() ).
                 append( "\n  Location    " ).append( location().get().getString() ).
-                append( "\n  Completed   " ).append( date.format( completionTime().get() ) ).
-                append( "\n  Registered  " ).append( date.format( registrationTime().get() ) ).
+                append( "\n  Completed   " ).append( completionTime().get() ).
+                append( "\n  Registered  " ).append( registrationTime().get() ).
                 append( "\n  Voyage      " ).append( voyage ).
                 append( "\n--------------------------------\n" );
 

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/data/structure/itinerary/Itinerary.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/data/structure/itinerary/Itinerary.java b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/data/structure/itinerary/Itinerary.java
index 41d2d4f..ccb7d5e 100644
--- a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/data/structure/itinerary/Itinerary.java
+++ b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/data/structure/itinerary/Itinerary.java
@@ -18,10 +18,10 @@
 package org.qi4j.sample.dcicargo.sample_b.data.structure.itinerary;
 
 import java.text.SimpleDateFormat;
-import java.util.Date;
+import java.time.LocalDate;
+import java.time.ZonedDateTime;
+import java.time.temporal.ChronoUnit;
 import java.util.List;
-import org.joda.time.Days;
-import org.joda.time.LocalDate;
 import org.qi4j.api.mixin.Mixins;
 import org.qi4j.api.property.Property;
 import org.qi4j.api.value.ValueComposite;
@@ -49,7 +49,7 @@ public interface Itinerary
 
     Leg lastLeg();
 
-    Date eta();
+    ZonedDateTime eta();
 
     int days();
 
@@ -78,16 +78,16 @@ public interface Itinerary
             return legs().get().get( legs().get().size() - 1 );
         }
 
-        public Date eta()
+        public ZonedDateTime eta()
         {
             return lastLeg().unloadTime().get();
         }
 
         public int days()
         {
-            Date dep = firstLeg().loadTime().get();
-            Date arr = lastLeg().unloadTime().get();
-            return Days.daysBetween( new LocalDate( dep ), new LocalDate( arr ) ).getDays();
+            ZonedDateTime dep = firstLeg().loadTime().get();
+            ZonedDateTime arr = lastLeg().unloadTime().get();
+            return (int) dep.until( arr, ChronoUnit.DAYS );
         }
 
         public String print()
@@ -104,11 +104,11 @@ public interface Itinerary
         {
             sb.append( "\n  Leg " ).append( i );
             sb.append( "  Load " );
-            sb.append( new SimpleDateFormat( "yyyy-MM-dd" ).format( leg.loadTime().get() ) );
+            sb.append( leg.loadTime().get() );
             sb.append( " " ).append( leg.loadLocation().get() );
             sb.append( "   " ).append( leg.voyage().get() );
             sb.append( "   Unload " );
-            sb.append( new SimpleDateFormat( "yyyy-MM-dd" ).format( leg.unloadTime().get() ) );
+            sb.append( leg.unloadTime().get() );
             sb.append( " " ).append( leg.unloadLocation().get() );
         }
     }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/data/structure/itinerary/Leg.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/data/structure/itinerary/Leg.java b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/data/structure/itinerary/Leg.java
index bbcc286..e4c621c 100644
--- a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/data/structure/itinerary/Leg.java
+++ b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/data/structure/itinerary/Leg.java
@@ -17,7 +17,8 @@
  */
 package org.qi4j.sample.dcicargo.sample_b.data.structure.itinerary;
 
-import java.util.Date;
+import java.time.LocalDate;
+import java.time.ZonedDateTime;
 import org.qi4j.api.association.Association;
 import org.qi4j.api.property.Property;
 import org.qi4j.api.value.ValueComposite;
@@ -36,11 +37,11 @@ public interface Leg
 {
     Association<Location> loadLocation();
 
-    Property<Date> loadTime();
+    Property<ZonedDateTime> loadTime();
 
     Association<Voyage> voyage();
 
-    Property<Date> unloadTime();
+    Property<ZonedDateTime> unloadTime();
 
     Association<Location> unloadLocation();
 }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/data/structure/voyage/CarrierMovement.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/data/structure/voyage/CarrierMovement.java b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/data/structure/voyage/CarrierMovement.java
index 20a2442..a189098 100644
--- a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/data/structure/voyage/CarrierMovement.java
+++ b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/data/structure/voyage/CarrierMovement.java
@@ -17,7 +17,7 @@
  */
 package org.qi4j.sample.dcicargo.sample_b.data.structure.voyage;
 
-import java.util.Date;
+import java.time.ZonedDateTime;
 import org.qi4j.api.association.Association;
 import org.qi4j.api.property.Property;
 import org.qi4j.api.value.ValueComposite;
@@ -37,7 +37,7 @@ public interface CarrierMovement
 
     Association<Location> arrivalLocation();
 
-    Property<Date> departureTime();
+    Property<ZonedDateTime> departureTime();
 
-    Property<Date> arrivalTime();
+    Property<ZonedDateTime> arrivalTime();
 }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/infrastructure/wicket/form/DateTextFieldWithPicker.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/infrastructure/wicket/form/DateTextFieldWithPicker.java b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/infrastructure/wicket/form/DateTextFieldWithPicker.java
index 26e09aa..361ae8c 100644
--- a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/infrastructure/wicket/form/DateTextFieldWithPicker.java
+++ b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/infrastructure/wicket/form/DateTextFieldWithPicker.java
@@ -18,6 +18,9 @@
 package org.qi4j.sample.dcicargo.sample_b.infrastructure.wicket.form;
 
 import com.google.code.joliratools.StatelessAjaxEventBehavior;
+import java.time.LocalDate;
+import java.time.ZoneId;
+import java.time.format.DateTimeFormatter;
 import java.util.Date;
 import java.util.Map;
 import org.apache.wicket.Component;
@@ -33,9 +36,6 @@ import org.apache.wicket.model.Model;
 import org.apache.wicket.model.PropertyModel;
 import org.apache.wicket.request.mapper.parameter.PageParameters;
 import org.apache.wicket.validation.validator.DateValidator;
-import org.joda.time.DateTime;
-import org.joda.time.LocalDate;
-import org.joda.time.LocalTime;
 
 /**
  * DateTextFieldWithPicker
@@ -187,7 +187,7 @@ public class DateTextFieldWithPicker extends DateTextField
 
         // Input field validation - date should be _after_ minimumDate (not the same)
         LocalDate minimumDate = newEarliestDate.minusDays( 1 );
-        Date convertedMinimumDate = new DateTime( minimumDate.toDateTime( new LocalTime() ) ).toDate();
+        Date convertedMinimumDate = new Date( minimumDate.plusDays(1).atStartOfDay( ZoneId.systemDefault() ).toInstant().toEpochMilli() );
         add( DateValidator.minimum( convertedMinimumDate ) );
 
         return this;
@@ -211,17 +211,22 @@ public class DateTextFieldWithPicker extends DateTextField
     {
         if( selectedDate != null )
         {
-            return selectedDate.toString( YUI_DATE_FORMAT );
+            return formatDate( selectedDate );
         }
 
         // Select today or earliest date (if later) as default
         return earliestDate == null ?
-               new LocalDate().toString( YUI_DATE_FORMAT ) :
-               earliestDate.toString( YUI_DATE_FORMAT );
+               formatDate( LocalDate.now() ) :
+               formatDate( earliestDate );
+    }
+
+    private String formatDate( LocalDate date )
+    {
+        return date.format( DateTimeFormatter.ofPattern( YUI_DATE_FORMAT ) );
     }
 
     private String getEarliestDateStr()
     {
-        return earliestDate == null ? "" : earliestDate.toString( YUI_DATE_FORMAT );
+        return earliestDate == null ? "" : formatDate( earliestDate );
     }
 }
\ No newline at end of file


Mime
View raw message