{
    "sourceFile": "adhan-webapp/test_offsets.py",
    "activeCommit": 0,
    "commits": [
        {
            "activePatchIndex": 1,
            "patches": [
                {
                    "date": 1748347843183,
                    "content": "Index: \n===================================================================\n--- \n+++ \n"
                },
                {
                    "date": 1748347851222,
                    "content": "Index: \n===================================================================\n--- \n+++ \n@@ -1,71 +1,1 @@\n-#!/usr/bin/env python3\n-\n-import json\n-import sys\n-from datetime import datetime, timedelta\n-\n-def apply_prayer_offsets(gebedstijden, settings):\n-    \"\"\"Pas offsets toe op gebedstijden\"\"\"\n-    offsets = {\n-        'Fajr': settings.get('fajr_offset', 0),\n-        'Zuhr': settings.get('zuhr_offset', 0),\n-        'Asr': settings.get('asr_offset', 0),\n-        'Maghrib': settings.get('maghrib_offset', 0),\n-        'Isha': settings.get('isha_offset', 0)\n-    }\n-    \n-    adjusted_times = {}\n-    \n-    for prayer, original_time in gebedstijden.items():\n-        offset_minutes = offsets.get(prayer, 0)\n-        \n-        if offset_minutes == 0:\n-            adjusted_times[prayer] = original_time\n-            continue\n-            \n-        try:\n-            # Parse de originele tijd\n-            time_obj = datetime.strptime(original_time, '%H:%M')\n-            \n-            # Voeg offset toe\n-            adjusted_time = time_obj + timedelta(minutes=offset_minutes)\n-            \n-            # Converteer terug naar string\n-            adjusted_times[prayer] = adjusted_time.strftime('%H:%M')\n-            \n-            if offset_minutes != 0:\n-                print(f\"📅 {prayer}: {original_time} → {adjusted_times[prayer]} ({offset_minutes:+d} min)\")\n-                \n-        except Exception as e:\n-            print(f\"⚠️ Fout bij aanpassen {prayer} tijd: {e}\")\n-            adjusted_times[prayer] = original_time\n-    \n-    return adjusted_times\n-\n-# Test de functie\n-if __name__ == \"__main__\":\n-    # Laad settings\n-    with open('settings.json') as f:\n-        settings = json.load(f)\n-    \n-    # Test gebedstijden (zoals van VUMG API)\n-    test_gebedstijden = {\n-        \"Fajr\": \"05:30\",\n-        \"Zuhr\": \"12:45\", \n-        \"Asr\": \"15:20\",\n-        \"Maghrib\": \"17:55\",\n-        \"Isha\": \"19:30\"\n-    }\n-    \n-    print(\"=== OFFSET TEST ===\")\n-    print(\"Originele tijden:\")\n-    for prayer, time in test_gebedstijden.items():\n-        offset = settings.get(f'{prayer.lower()}_offset', 0)\n-        print(f\"  {prayer}: {time} (offset: {offset:+d} min)\")\n-    \n-    print(\"\\nAangepaste tijden:\")\n-    adjusted = apply_prayer_offsets(test_gebedstijden, settings)\n-    \n-    print(\"\\nResultaat:\")\n-    for prayer, time in adjusted.items():\n-        print(f\"  {prayer}: {time}\") \n\\ No newline at end of file\n+ \n\\ No newline at end of file\n"
                }
            ],
            "date": 1748347843183,
            "name": "Commit-0",
            "content": "#!/usr/bin/env python3\n\nimport json\nimport sys\nfrom datetime import datetime, timedelta\n\ndef apply_prayer_offsets(gebedstijden, settings):\n    \"\"\"Pas offsets toe op gebedstijden\"\"\"\n    offsets = {\n        'Fajr': settings.get('fajr_offset', 0),\n        'Zuhr': settings.get('zuhr_offset', 0),\n        'Asr': settings.get('asr_offset', 0),\n        'Maghrib': settings.get('maghrib_offset', 0),\n        'Isha': settings.get('isha_offset', 0)\n    }\n    \n    adjusted_times = {}\n    \n    for prayer, original_time in gebedstijden.items():\n        offset_minutes = offsets.get(prayer, 0)\n        \n        if offset_minutes == 0:\n            adjusted_times[prayer] = original_time\n            continue\n            \n        try:\n            # Parse de originele tijd\n            time_obj = datetime.strptime(original_time, '%H:%M')\n            \n            # Voeg offset toe\n            adjusted_time = time_obj + timedelta(minutes=offset_minutes)\n            \n            # Converteer terug naar string\n            adjusted_times[prayer] = adjusted_time.strftime('%H:%M')\n            \n            if offset_minutes != 0:\n                print(f\"📅 {prayer}: {original_time} → {adjusted_times[prayer]} ({offset_minutes:+d} min)\")\n                \n        except Exception as e:\n            print(f\"⚠️ Fout bij aanpassen {prayer} tijd: {e}\")\n            adjusted_times[prayer] = original_time\n    \n    return adjusted_times\n\n# Test de functie\nif __name__ == \"__main__\":\n    # Laad settings\n    with open('settings.json') as f:\n        settings = json.load(f)\n    \n    # Test gebedstijden (zoals van VUMG API)\n    test_gebedstijden = {\n        \"Fajr\": \"05:30\",\n        \"Zuhr\": \"12:45\", \n        \"Asr\": \"15:20\",\n        \"Maghrib\": \"17:55\",\n        \"Isha\": \"19:30\"\n    }\n    \n    print(\"=== OFFSET TEST ===\")\n    print(\"Originele tijden:\")\n    for prayer, time in test_gebedstijden.items():\n        offset = settings.get(f'{prayer.lower()}_offset', 0)\n        print(f\"  {prayer}: {time} (offset: {offset:+d} min)\")\n    \n    print(\"\\nAangepaste tijden:\")\n    adjusted = apply_prayer_offsets(test_gebedstijden, settings)\n    \n    print(\"\\nResultaat:\")\n    for prayer, time in adjusted.items():\n        print(f\"  {prayer}: {time}\") "
        }
    ]
}