added created.dd and modified.dd to template system, closes #135

This commit is contained in:
Rhet Turnbull
2020-05-23 21:39:40 -07:00
parent af750dd2e3
commit 28935b0af9
7 changed files with 48 additions and 1 deletions

View File

@@ -0,0 +1,21 @@
""" test datetime_formatter.DateTimeFormatter """
import pytest
def test_datetime_formatter():
import datetime
import locale
from osxphotos.datetime_formatter import DateTimeFormatter
locale.setlocale(locale.LC_ALL, "en_US")
dt = datetime.datetime(2020,5,23)
dtf = DateTimeFormatter(dt)
assert dtf.date == "2020-05-23"
assert dtf.year == "2020"
assert dtf.yy == "20"
assert dtf.month == "May"
assert dtf.mon == "May"
assert dtf.mm == "05"
assert dtf.dd == "23"
assert dtf.doy == "144"

View File

@@ -29,6 +29,7 @@ TEMPLATE_VALUES = {
"{created.mm}": "02",
"{created.month}": "February",
"{created.mon}": "Feb",
"{created.dd}": "04",
"{created.doy}": "035",
"{modified.date}": "2020-03-21",
"{modified.year}": "2020",
@@ -36,6 +37,7 @@ TEMPLATE_VALUES = {
"{modified.mm}": "03",
"{modified.month}": "March",
"{modified.mon}": "Mar",
"{modified.dd}": "21",
"{modified.doy}": "081",
"{place.name}": "Washington, District of Columbia, United States",
"{place.country_code}": "US",
@@ -64,6 +66,7 @@ TEMPLATE_VALUES_DEU = {
"{created.mm}": "02",
"{created.month}": "Februar",
"{created.mon}": "Feb",
"{created.dd}": "04",
"{created.doy}": "035",
"{modified.date}": "2020-03-21",
"{modified.year}": "2020",
@@ -71,6 +74,7 @@ TEMPLATE_VALUES_DEU = {
"{modified.mm}": "03",
"{modified.month}": "März",
"{modified.mon}": "Mär",
"{modified.dd}": "21",
"{modified.doy}": "081",
"{place.name}": "Washington, District of Columbia, United States",
"{place.country_code}": "US",