You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hop.apache.org by "evanofjd (via GitHub)" <gi...@apache.org> on 2026/03/10 15:51:40 UTC
[I] [Bug]: JavaScript transform plugin truncDate functionality changed and does not match documentation (hop)
evanofjd opened a new issue, #6754:
URL: https://github.com/apache/hop/issues/6754
### Apache Hop version?
2.17.0
### Java version?
openjdk version "17.0.18" 2026-01-20 LTS
### Operating system
Windows
### What happened?
**Steps to reproduce the issue:**
In a pipeline, add the JavaScript step with the following code:
var dateTime = new Date();
var date3 = truncDate(dateTime, 3); // gives back today at yyyy/MM/dd 00:00:00.000
Add date3 to the fields "exported" by the JavaScript step.
Write the value of date3 to log.
If this is run at 2026/03/10 11:53:53, the actual result would be date3 = "2026/03/10 00:53:53".
**Expected result:**
If this is run at 2026/03/10 11:53:53, the expected result is date3 = "2026/03/10 00:00:00".
That is what the documentation in the sample says (see example code above, which was copied from the sample).
**Cause of functionality change**
This PR https://github.com/apache/hop/pull/5931 added "breaks" after each of the switch options in the truncDate method in plugins/transforms/javascript/src/main/java/org/apache/hop/pipeline/transforms/javascript/ScriptValuesAddedFunctions.java. Therefore, with truncDate(dateTime, 3) ONLY the hour is truncated, not the minutes, seconds, milliseconds.
### Issue Priority
Priority: 3
### Issue Component
Component: Transforms
--
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: issues-unsubscribe@hop.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Bug]: JavaScript transform plugin truncDate functionality changed and does not match documentation (hop)
Posted by "mattcasters (via GitHub)" <gi...@apache.org>.
mattcasters closed issue #6754: [Bug]: JavaScript transform plugin truncDate functionality changed and does not match documentation
URL: https://github.com/apache/hop/issues/6754
--
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: issues-unsubscribe@hop.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Bug]: JavaScript transform plugin truncDate functionality changed and does not match documentation (hop)
Posted by "leehaut (via GitHub)" <gi...@apache.org>.
leehaut commented on issue #6754:
URL: https://github.com/apache/hop/issues/6754#issuecomment-4035583683
.take-issue
--
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: issues-unsubscribe@hop.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org