This question is answered.


Permlink Replies: 17 - Pages: 2 [ 1 2 | Next ] - Last Post: 23-Sep-2020 15:25 Last Post By: AndreWolff Threads: [ Previous | Next ]
AndreWolff

Posts: 1,916
Registered: 14-Dec-2007
Use variable originalDate also for the recoding date of a video
Posted: 20-Sep-2020 14:15
 
  Click to reply to this thread Reply
I like to show the exposure date of the images and videos.
So I use jAlbum variable originalDate to fetch the exposure date.
However this works only for images, not for video files.

So my request is:

Please load the recording date of a video also into variable originalDate.
RobM

Posts: 3,419
Registered: 4-Aug-2006
Re: Use variable originalDate also for the recoding date of a video
Posted: 20-Sep-2020 14:50   in response to: AndreWolff in response to: AndreWolff
 
  Click to reply to this thread Reply
There are issues with video creation dates, see https://jalbum.net/forum/thread.jspa?messageID=338381&#338381
The issue has yet to be addressed.
AndreWolff

Posts: 1,916
Registered: 14-Dec-2007
Re: Use variable originalDate also for the recoding date of a video
Posted: 20-Sep-2020 17:29   in response to: RobM in response to: RobM
 
  Click to reply to this thread Reply
RobM wrote:
There are issues with video creation dates, see https://jalbum.net/forum/thread.jspa?messageID=338381&#338381
The issue has yet to be addressed.
I am not interested in the creation time, only in the creation date.
davidekholm

Posts: 3,493
Registered: 18-Oct-2002
Re: Use variable originalDate also for the recoding date of a video
Posted: 21-Sep-2020 14:04   in response to: AndreWolff in response to: AndreWolff
Helpful
  Click to reply to this thread Reply
I've now updated jAlbum 22.0.3 to pass the original date of videos (mp4 and QuickTime) to the "originalDate" variables. Do a core update to test it.

I've tested the update for both videos and images. Here is my test code (Minimal's slide.htt):
<body>
Original date: ${originalDate} <br>
<ja:exists="originalDate">Original date (formatted): <%=  Dates.format(originalDate, "yyyy-MMM-dd") %> <br>


Prints this for a video:
Original date: 2018-09-26, 16:15
Original date (formatted): 2018-Sep-26
davidekholm

Posts: 3,493
Registered: 18-Oct-2002
Re: Use variable originalDate also for the recoding date of a video
Posted: 21-Sep-2020 14:06   in response to: AndreWolff in response to: AndreWolff
Correct
  Click to reply to this thread Reply
I've now updated jAlbum 22.0.3 to pass the original date of videos (mp4 and QuickTime) to the "originalDate" variables. Do a core update to test it.

I've tested the update for both videos and images. Here is my test code (Minimal's slide.htt):
<body>
Original date: ${originalDate} <br>
<ja:if exists="originalDate">
Original date (formatted): <%=  Dates.format(originalDate, "yyyy-MMM-dd") %>
</ja:if> <br>
 


Prints this for a video:
Original date: 2018-09-26, 16:15
Original date (formatted): 2018-Sep-26
AndreWolff

Posts: 1,916
Registered: 14-Dec-2007
Re: Use variable originalDate also for the recoding date of a video
Posted: 21-Sep-2020 16:04   in response to: davidekholm in response to: davidekholm
 
  Click to reply to this thread Reply
Yes David, that works great, see my test album.

Thanks a lot!
davidekholm

Posts: 3,493
Registered: 18-Oct-2002
Re: Use variable originalDate also for the recoding date of a video
Posted: 21-Sep-2020 16:17   in response to: AndreWolff in response to: AndreWolff
 
  Click to reply to this thread Reply
You're welcome!
AndreWolff

Posts: 1,916
Registered: 14-Dec-2007
Re: Use variable originalDate also for the recoding date of a video
Posted: 22-Sep-2020 08:50   in response to: davidekholm in response to: davidekholm
 
  Click to reply to this thread Reply
davidekholm wrote:
You're welcome!
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.

Edited by: AndreWolff on 22-Sep-2020 09:34
davidekholm

Posts: 3,493
Registered: 18-Oct-2002
Re: Use variable originalDate also for the recoding date of a video
Posted: 22-Sep-2020 12:55   in response to: AndreWolff in response to: AndreWolff
Helpful
  Click to reply to this thread Reply
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>
AndreWolff

Posts: 1,916
Registered: 14-Dec-2007
Re: Use variable originalDate also for the recoding date of a video
Posted: 22-Sep-2020 14:20   in response to: davidekholm in response to: davidekholm
 
  Click to reply to this thread Reply
Well David, I think you make it difficult for your users to define a Date format at two places without indicating where it is used!
I think you should remove one.

But anyhow, I entered 'dd-MM-yyyy' in the Date format field under Settings / Advanced and got the format I wanted, without applying your
<%=  Dates.format(originalDate, Dates.stripTime(engine.getDateFormat())) %>
code, as you can see in my test album.

Thanks again for your help!
davidekholm

Posts: 3,493
Registered: 18-Oct-2002
Re: Use variable originalDate also for the recoding date of a video
Posted: 23-Sep-2020 10:32   in response to: AndreWolff in response to: AndreWolff
 
  Click to reply to this thread Reply
Yes, removing the time portion from the date format will work too.
This is how to distinguish between "Settings" and "Preferences":

Settings = stuff that affects the generated album
Preferences = stuff that affects the behavior of the software itself
AndreWolff

Posts: 1,916
Registered: 14-Dec-2007
Re: Use variable originalDate also for the recoding date of a video
Posted: 23-Sep-2020 11:34   in response to: davidekholm in response to: davidekholm
 
  Click to reply to this thread Reply
davidekholm wrote:
Settings = stuff that affects the generated album
Preferences = stuff that affects the behavior of the software itself
Yes, I see.
I hope this will also be indicated in the help documentation and / or in the UI.
davidekholm

Posts: 3,493
Registered: 18-Oct-2002
Re: Use variable originalDate also for the recoding date of a video
Posted: 23-Sep-2020 12:20   in response to: AndreWolff in response to: AndreWolff
 
  Click to reply to this thread Reply
We can add it to the docs. This is the way desktop software has been behaving for decades.
AndreWolff

Posts: 1,916
Registered: 14-Dec-2007
Re: Use variable originalDate also for the recoding date of a video
Posted: 23-Sep-2020 13:59   in response to: davidekholm in response to: davidekholm
 
  Click to reply to this thread Reply
davidekholm wrote:
We can add it to the docs. This is the way desktop software has been behaving for decades.
Well most people do not read the docs or can't find the item, so a clear GUI text has my preference.
RobM

Posts: 3,419
Registered: 4-Aug-2006
Re: Use variable originalDate also for the recoding date of a video
Posted: 23-Sep-2020 14:04   in response to: davidekholm in response to: davidekholm
 
  Click to reply to this thread Reply
davidekholm wrote:
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.’
Legend
Forum admins
Helpful Answer
Correct Answer

Point your RSS reader here for a feed of the latest messages in all forums