You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hop.apache.org by "dave-csc (via GitHub)" <gi...@apache.org> on 2024/11/11 11:26:24 UTC
[I] [Feature Request]: Calculator - add Date generator (hop)
dave-csc opened a new issue, #4554:
URL: https://github.com/apache/hop/issues/4554
### 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
--
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] [Feature Request]: Calculator - add Date generator (hop)
Posted by "dave-csc (via GitHub)" <gi...@apache.org>.
dave-csc commented on issue #4554:
URL: https://github.com/apache/hop/issues/4554#issuecomment-2497237449
Note: I updated the workaround, since the `Integer` value in Hop is actually a `Long`/`long` type in Java rather than an `Integer`/`int`
--
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