apache / hop

Hop Orchestration Platform
https://hop.apache.org/
Apache License 2.0
985 stars 354 forks source link

[Feature Request]: Calculator - add Date generator #4554

Open dave-csc opened 1 week ago

dave-csc commented 1 week ago

What would you like to happen?

In the Calculator transform there are many operations to get and modify the various parts of a Date (year, month, day of month, day of week, etc.), ma no operation to get a Date object from its parts (year, month, day of month).

It could be useful to add an operation like "Create Date from Year A, Month B and Day of month C": the time part can be defaulted to midnight (and then modified with the already existing operations "Date A + B hours/minutes/seconds").

The current workaround consists in using a User Defined Java Expression transform, and create a field of type Date with an expression like: new java.util.GregorianCalendar(YEAR_FIELD, MONTH_FIELD - 1, DAY_OF_MONTH_FIELD).getTime() (beware of the -1 in the month field!)

Issue Priority

Priority: 3

Issue Component

Component: Hop Gui, Component: Transforms