This may sound silly, and I’m all for logic to be ran server-side, so could you make a simple function to do this calculation and return it back to the app? I know it seems like more effort for a trivial thing lol
I made a similar function for a dashboard default date … and even though it’s yet another call to the server, it’s a super simple function, so it’s super fast. On our system the response is back before the dashboard BAQ is finished running.
#_'(new Date(new Date().getFullYear() - 1, new Date().getMonth(), new Date().getDate())).toLocaleDateString()'_#
JavaScript is gross. Do what @jwphillips said and make a function. I have a library called “HelperFuncs” for stuff like this. Little one-liners and whatnot.