Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
dave-csc opened this issue Nov 11, 2024 · 1 comment
Open

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

dave-csc opened this issue Nov 11, 2024 · 1 comment

Comments

@dave-csc
Copy link
Contributor

dave-csc commented Nov 11, 2024

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.intValue(), MONTH_FIELD.intValue() - 1, DAY_OF_MONTH_FIELD.intValue()).getTime()
(beware of the -1 in the month field!)

Issue Priority

Priority: 3

Issue Component

Component: Hop Gui, Component: Transforms

@dave-csc
Copy link
Contributor Author

Note: I updated the workaround, since the Integer value in Hop is actually a Long/long type in Java rather than an Integer/int

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant