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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]