mirror of
https://github.com/skoelle/icloud-contacts-sync.git
synced 2026-09-17 15:30:24 +00:00
unknown year dashboard fix
This commit is contained in:
+2
-1
@@ -24,7 +24,7 @@ from api.auth import get_current_user, resolve_account_for_user
|
||||
from api.schemas import ContactListResponse, ContactOut, SyncRunOut
|
||||
from config import Config
|
||||
from mailer import build_message, fetch_birthdays_for_date, send_message
|
||||
from utils import fmt_birthday_age, fmt_birthday_short
|
||||
from utils import fmt_birthday_age, fmt_birthday_short, is_unknown_year
|
||||
|
||||
logging.basicConfig(level=Config.LOG_LEVEL, format="%(asctime)s [%(levelname)s] %(message)s")
|
||||
logger = logging.getLogger("api")
|
||||
@@ -36,6 +36,7 @@ templates = Jinja2Templates(directory="api/templates")
|
||||
templates.env.filters["urlquote"] = lambda s: quote_plus(s or "")
|
||||
templates.env.filters["fmt_birthday"] = fmt_birthday_short
|
||||
templates.env.filters["fmt_age"] = fmt_birthday_age
|
||||
templates.env.filters["has_year"] = lambda b: not is_unknown_year(b)
|
||||
|
||||
|
||||
def _fmt_ts(dt) -> str | None:
|
||||
|
||||
@@ -367,7 +367,7 @@
|
||||
<div class="birthday-organization">{{ b.organization }}</div>
|
||||
{% endif %}
|
||||
<div class="birthday-date">
|
||||
{{ b.birthday|fmt_birthday }}{% if b.birthday|fmt_age %} · {{ b.birthday|fmt_age(current_year) }} Jahre{% endif %}
|
||||
{{ b.birthday|fmt_birthday }}{% if b.birthday|has_year %} · {{ b.birthday|fmt_age(current_year) }} Jahre{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% if b.photo_url %}
|
||||
|
||||
Reference in New Issue
Block a user