Add timezone-aware date filtering for reports page

- Add parse_timezone_offset() helper to parse timezone strings (UTC+3, Africa/Johannesburg, etc.)
- Add get_date_range_in_timezone() helper to calculate date ranges with proper timezone conversion
- Update reports(), export_reports(), client_report_detail(), match_report_detail(), export_client_report(), and export_match_report() to use timezone-aware date filtering
- Users can now select their timezone and date filters will correctly convert local time boundaries to UTC for database queries
parent ff2344d2
This diff is collapsed.
<option value="auto" {% if filters.timezone == 'auto' or not filters.timezone %}selected{% endif %}>Auto (Browser Local)</option> <option value="auto" {% if filters.timezone == 'auto' or not filters.timezone %}selected{% endif %}>Auto (Browser Local)</option>
<option value="UTC" {% if filters.timezone == 'UTC' %}selected{% endif %}>UTC</option> <option value="UTC" {% if filters.timezone == 'UTC' %}selected{% endif %}>UTC</option>
<optgroup label="UTC Offsets">
<option value="UTC-12" {% if filters.timezone == 'UTC-12' %}selected{% endif %}>UTC-12 (Baker Island)</option>
<option value="UTC-11" {% if filters.timezone == 'UTC-11' %}selected{% endif %}>UTC-11 (American Samoa)</option>
<option value="UTC-10" {% if filters.timezone == 'UTC-10' %}selected{% endif %}>UTC-10 (Hawaii)</option>
<option value="UTC-9" {% if filters.timezone == 'UTC-9' %}selected{% endif %}>UTC-9 (Alaska)</option>
<option value="UTC-8" {% if filters.timezone == 'UTC-8' %}selected{% endif %}>UTC-8 (Pacific Time)</option>
<option value="UTC-7" {% if filters.timezone == 'UTC-7' %}selected{% endif %}>UTC-7 (Mountain Time)</option>
<option value="UTC-6" {% if filters.timezone == 'UTC-6' %}selected{% endif %}>UTC-6 (Central Time)</option>
<option value="UTC-5" {% if filters.timezone == 'UTC-5' %}selected{% endif %}>UTC-5 (Eastern Time)</option>
<option value="UTC-4" {% if filters.timezone == 'UTC-4' %}selected{% endif %}>UTC-4 (Atlantic Time)</option>
<option value="UTC-3" {% if filters.timezone == 'UTC-3' %}selected{% endif %}>UTC-3 (Brazil, Argentina)</option>
<option value="UTC-2" {% if filters.timezone == 'UTC-2' %}selected{% endif %}>UTC-2 (Mid-Atlantic)</option>
<option value="UTC-1" {% if filters.timezone == 'UTC-1' %}selected{% endif %}>UTC-1 (Azores)</option>
<option value="UTC+0" {% if filters.timezone == 'UTC+0' %}selected{% endif %}>UTC+0 (GMT/UTC)</option>
<option value="UTC+1" {% if filters.timezone == 'UTC+1' %}selected{% endif %}>UTC+1 (Central European)</option>
<option value="UTC+2" {% if filters.timezone == 'UTC+2' %}selected{% endif %}>UTC+2 (Eastern European, South Africa)</option>
<option value="UTC+3" {% if filters.timezone == 'UTC+3' %}selected{% endif %}>UTC+3 (Moscow, East Africa)</option>
<option value="UTC+4" {% if filters.timezone == 'UTC+4' %}selected{% endif %}>UTC+4 (Gulf Standard)</option>
<option value="UTC+5" {% if filters.timezone == 'UTC+5' %}selected{% endif %}>UTC+5 (Pakistan)</option>
<option value="UTC+5:30" {% if filters.timezone == 'UTC+5:30' %}selected{% endif %}>UTC+5:30 (India)</option>
<option value="UTC+6" {% if filters.timezone == 'UTC+6' %}selected{% endif %}>UTC+6 (Bangladesh)</option>
<option value="UTC+7" {% if filters.timezone == 'UTC+7' %}selected{% endif %}>UTC+7 (Indochina)</option>
<option value="UTC+8" {% if filters.timezone == 'UTC+8' %}selected{% endif %}>UTC+8 (China, Singapore)</option>
<option value="UTC+9" {% if filters.timezone == 'UTC+9' %}selected{% endif %}>UTC+9 (Japan, Korea)</option>
<option value="UTC+10" {% if filters.timezone == 'UTC+10' %}selected{% endif %}>UTC+10 (Eastern Australia)</option>
<option value="UTC+11" {% if filters.timezone == 'UTC+11' %}selected{% endif %}>UTC+11 (Solomon Islands)</option>
<option value="UTC+12" {% if filters.timezone == 'UTC+12' %}selected{% endif %}>UTC+12 (New Zealand)</option>
<option value="UTC+13" {% if filters.timezone == 'UTC+13' %}selected{% endif %}>UTC+13 (Phoenix Islands)</option>
<option value="UTC+14" {% if filters.timezone == 'UTC+14' %}selected{% endif %}>UTC+14 (Line Islands)</option>
</optgroup>
<optgroup label="Africa"> <optgroup label="Africa">
<option value="Africa/Abidjan" {% if filters.timezone == 'Africa/Abidjan' %}selected{% endif %}>Abidjan</option> <option value="Africa/Abidjan" {% if filters.timezone == 'Africa/Abidjan' %}selected{% endif %}>Abidjan</option>
<option value="Africa/Accra" {% if filters.timezone == 'Africa/Accra' %}selected{% endif %}>Accra</option> <option value="Africa/Accra" {% if filters.timezone == 'Africa/Accra' %}selected{% endif %}>Accra</option>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment