xiazcy commented on code in PR #3090:
URL: https://github.com/apache/tinkerpop/pull/3090#discussion_r2029528973


##########
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/DateAddStep.java:
##########
@@ -57,16 +46,32 @@ public DateAddStep(final Traversal.Admin traversal, final 
DT dateToken, final in
     }
 
     @Override
-    protected Date map(final Traverser.Admin<S> traverser) {
+    protected OffsetDateTime map(final Traverser.Admin<S> traverser) {
         final Object object = traverser.get();
 
-        if (!(object instanceof Date)) throw new 
IllegalArgumentException("dateAdd accept only Date.");
-
-        final Calendar cal = Calendar.getInstance();
-        cal.setTime((Date) object);
-        cal.add(DTtoCalendar.get(dateToken), value);
-
-        return cal.getTime();
+        if (!(object instanceof OffsetDateTime)) throw new 
IllegalArgumentException("dateAdd accept only DateTime.");

Review Comment:
   We changed it a general DateTime type in 4.0, but you are right it prob make 
more sense to be OffsetDateTime here. I will also make it accept Date as well 
for compatibility reasons. 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to