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

Output TZ field from msg.x value #31

Closed
justinj0001 opened this issue Mar 29, 2020 · 3 comments
Closed

Output TZ field from msg.x value #31

justinj0001 opened this issue Mar 29, 2020 · 3 comments
Labels
Completed Enhancement completed or bug fixed enhancement

Comments

@justinj0001
Copy link

I need to do timezone conversions based on a value that will be passed to the node in a msg.x field.
Data being converted from is all in UTC and the users timezone string (i.e. Australia/Melbourne) from an SQL query will determine the timezone it will convert to. If I manually set in Output TZ it converts correctly but I need it to be dynamic.
I've tried entering the field as msg.payload.timezone which contains the timezone string but just get the following error as the data is parsed as entered rather than the actual message content.
How do I do what I need to?

Moment: Output Timezone Invalid, reset to UTC - see http://momentjs.com/timezone/docs/#/data-loading/

@TotallyInformation
Copy link
Owner

Sorry, been a while since I looked at the code. Make take me a bit to get to looking as I'm rather tied up with COVID related issues right now.

@justinj0001
Copy link
Author

Understandable. We're all in the same boat.
I've had a brief look and I probably could do a pull and change on it but JS is far from my forte so if someone else versed in JS could have a look it would probably be much smoother.

@TotallyInformation TotallyInformation added enhancement Completed Enhancement completed or bug fixed and removed More Info Needed help wanted labels Oct 2, 2020
@TotallyInformation
Copy link
Owner

Good, if rather delayed, news.

From v4 of this node, due to be released imminently, both the input and the output timezones can be set from the input msg.

msg.inTz and msg.outTz are the two properties to use.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Completed Enhancement completed or bug fixed enhancement
Projects
None yet
Development

No branches or pull requests

2 participants