Hi - I am using a snippet with a variable data field for the date. I have it formatted as such in the text script - formatter.dateLong(field). This works fine and displays as January 1, 2022 if I use the field anywhere in the print section. However when I use the date field in a snippet it shows as Sat Jan 01 2022 00:00:00 GMT-0500 (EST).
How do I get the date in the snippet to read the same as it does in the document? My date format in the .csv file is 1-Jan-22?
Scripts are executed in the order in which they appear in the Scripts pane. I suggest to check the order and make sure that the Text script is executed after the one used for loading the snippet.
Try disabling all scripts except for the two relevant scripts; i.e. the script that loads the snippet and the @EffDate@ script. If it now behaves as expected there might be a third script somewhere that causes the problem.
You can also use the script debugger (the button with a green bug in the Scripts panel) to step through your scripts to see how and when they affect content.