ux(history): show day name in Work Log Payroll modal header

date in the modal header was "2026-05-15" — now reads
"Friday, 15 May 2026". Server-side strftime on the already-loaded
log.date — zero DB / compute overhead. Touches only the modal's
date field; other date fields in the JSON (paid_date,
pay_period_*) still use the ISO format because they don't render
into a human-facing header.
This commit is contained in:
Konrad du Plessis 2026-05-15 00:57:38 +02:00
parent bde6f24bb1
commit 70fa085886

View File

@ -1262,7 +1262,10 @@ def work_log_payroll_ajax(request, log_id):
return JsonResponse({
'log_id': log.id,
'date': _date_iso(log.date),
# Human-readable so the modal header reads "Friday, 15 May 2026"
# instead of "2026-05-15". strftime is zero-overhead — the date
# object is already in memory.
'date': log.date.strftime('%A, %d %B %Y'),
'project': {'id': log.project.id, 'name': log.project.name} if log.project else None,
'team': {'id': log.team.id, 'name': log.team.name} if log.team else None,
# get_full_name() returns "" if no first/last, so fall back to username.