Javascript assets: helper functions

I’m trying to create a javascript helper function to convert a datetime (UTC) to the local browser timezone.

I’ve tried all options documented here but can’t get any to work.

The js asset is called “js_utils.js” and contains a function called “convertUTCToLocal”. How can I import and call the function?

Many thanks in advance!

where is that js file located? Locally uploaded in the theme assets? From a third party library?

Have you loaded it in Native libraries in a script tag?

The js file is created in “Assets”. I assume those are theme assets?
I loaded it in the “standard-page.html” file using a script tag. I just tried adding it to the Native libraries but that didn’t work either.

I think you might need to set it explicitly onto the window object like so:

function someJS() {
    // Your JS Utility function;
};

window.someJS = someJS;

@jeremy.deceuster if you’re still having issues, creating a minimal clone link that shows your app structure will be helpful when providing specific advice.

you might also want to share the javascript helper function.
The Python datetime module might already have what you need.

Managed to make it work, thank you both!