mirror of
https://github.com/DRYTRIX/TimeTracker.git
synced 2026-01-07 12:10:04 -06:00
The Time Entry Templates page (/templates) was throwing a 500 error when displaying templates with usage data. The templates referenced a 'timeago' Jinja2 filter that was never registered. Changes: - Added timeago filter to app/utils/template_filters.py - Converts datetime to human-readable relative time (e.g., "2 hours ago") - Handles None, naive/aware datetimes, and future dates gracefully - Provides appropriate granularity from seconds to years - Uses proper singular/plural forms - Added 11 comprehensive unit tests in tests/test_utils.py - Tests for None values, all time ranges, edge cases - Tests for naive datetimes and future dates - Tests for singular/plural formatting - Added smoke test in tests/test_time_entry_templates.py - Specifically tests templates with usage_count and last_used_at - Ensures the filter renders correctly in the template The filter is used in: - app/templates/time_entry_templates/list.html (line 96) - app/templates/time_entry_templates/edit.html (line 140) Fixes #151