Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

UI Builder Calendar Component Form Controller Query Help

Shawn Beckman
Tera Contributor

I am currently facing an issue with the query field in a form controller. Specifically, I am trying to push a valid date/time value into this field, but the displayed value in the modal has a 6-hour offset into the future.

Here are the details:

  • Problem: When I push a query value into the form controller, the date/time value in the modal is offset by 6 hours.
  • Suspected Cause: I believe this issue might be related to the moment.js date/time timezone settings, but I am unsure how to adjust them correctly.
  • Attempts: I have tried various methods to set the date/time value, but none have resolved the offset issue.
  • Example:
    • Query value input: start_date=javascript:gs.dateGenerate('2025-04-23','18:30:00')
    • Result: 2025-04-24 00:30:00

Has anyone encountered a similar problem or can provide guidance on how to adjust the timezone settings in moment.js to fix this offset?

Thank you in advance for your help!

0 REPLIES 0