David, there is still a format problem with the contents delivered in variable originalDate :
In the preferences window I have for the Date Format, the Dutch date format: 'dd-mm-yyyy HH:mm', but the format delivered in originalDate is yyyy-mm-dd as you can see in my test album.
Users will expect that all date / time output generated by jAlbum will be displayed in the Date format indicated in the Preferences window.
So after you fill originalDate, you should format the contents with the Date format indicated in the preferences window, both for an image and for a video.
BTW: How can I fetch the contents of the Date format in the preferences window? I can't find the global variable to fetch that format.
Or may be you can offer two functions ConvertToPrefDateFormat and ConvertToPrefDateTimeFormat to convert a string to the Date format indicated in the preferences window.
The date format field under Preferences is just for how jAlbum is to print dates within it's own user interface. Use the date format field under Settings->Advanced->General.
If you wish to programmatically pick up that date format (pattern), then call engine.getDateFormat(). If you wish to get the time portion stripped, then call Dates.stripTime(engine.getDateFormat()). Note, you need to do a core update first (v22.0.4)
Here's a complete example that respects the format entered under Settings->Advanced->General but strips the time portion:
Original date (stripped): <%= Dates.format(originalDate, Dates.stripTime(engine.getDateFormat())) %> <br>
We can add it to the docs. This is the way desktop software has been behaving for decades.
It already is in the docs
‘ Preferences are settings that affect the behavior of the program. They don't affect the resulting album (the language and lifeboat file preferences being the exception). Preferences are global, i.e. they don't apply to a specific album or project, they are saved as defaults.jap in the configuration directory (Menu/Tools/Open Directories/config directory). For settings affecting the album, see jAlbum/Settings.’