added created.dow (day of week) to template

This commit is contained in:
Stephane
2020-05-24 14:20:25 +02:00
parent 28935b0af9
commit 8df6d2c707
3 changed files with 11 additions and 1 deletions

View File

@@ -50,7 +50,13 @@ class DateTimeFormatter:
""" 2-digit day of the month """
dd = f"{self.dt.strftime('%d')}"
return dd
@property
def dow(self):
""" Day of week as locale's name """
dow = f"{self.dt.strftime('%A')}"
return dow
@property
def doy(self):
""" Julian day of year starting from 001 """

View File

@@ -839,6 +839,9 @@ class PhotoInfo:
if lookup == "created.dd":
return DateTimeFormatter(self.date).dd
if lookup == "created.dow":
return DateTimeFormatter(self.date).dow
if lookup == "created.doy":
return DateTimeFormatter(self.date).doy

View File

@@ -27,6 +27,7 @@ TEMPLATE_SUBSTITUTIONS = {
"{created.month}": "Month name in user's locale of the file creation time",
"{created.mon}": "Month abbreviation in the user's locale of the file creation time",
"{created.dd}": "2-digit day of the month (zero padded) of file creation time",
"{created.dow}": "Day of week in user's locale of the file creation time",
"{created.doy}": "3-digit day of year (e.g Julian day) of file creation time, starting from 1 (zero padded)",
"{modified.date}": "Photo's modification date in ISO format, e.g. '2020-03-22'",
"{modified.year}": "4-digit year of file modification time",