Goal:
Pull monthly day totals excluding holidays and weekends. Ex: July 2024, this would show 22 days since there were 4 weekends and 1 holiday (4th of July)
Steps: The data would be visualized on a page element like in the screenshot.
I've tried to create a variable using Moment.js or other libraries but I get an error indicating you "Cannot use import statement outside a module".
There does seem to be a nice extension to moment that would do the trick here but it doesn't seem to be compatible with our "Libraries" feature, for whatever reason. For reference, you can load in external libraries via the "App Settings -> Libraries" menu. This bypasses the need to write require or import statements.
The above query I wrote is spitting out 22, which aligns with what we would expect to see for August! We can then connect the data source for some component on our page to the output of this query.
Definitely let us know if you have any questions about the logic or syntax here - everybody has varying levels of experience writing JS scripts.