prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Use <time> element for dates
  This way screen readers (and other ATs) know that it should be read as a date.
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `meinberlin/apps/contrib/templatetags/contrib_tags.py`
  Content:
  ```
  1 from django import template
  2 from django.template.loader import render_to_string
  3 
  4 register = template.Library()
  5 
  6 
  7 @register.assignment_tag
  8 def include_template_string(template, **kwargs):
  9     rendered_template = render_to_string(template, kwargs)
  10     return str(rendered_template)
  11 
  12 
  13 @register.assignment_tag
  14 def combined_url_parameter(request_query_dict, **kwargs):
  15     combined_query_dict = request_query_dict.copy()
  16     for key in kwargs:
  17         combined_query_dict.setlist(key, [kwargs[key]])
  18     encoded_parameter = '?' + combined_query_dict.urlencode()
  19     return encoded_parameter
  20 
  21 
  22 @register.assignment_tag
  23 def filter_has_perm(perm, user, objects):
  24     """Filter a list of objects based on user permissions."""
  25     if not hasattr(user, 'has_perm'):
  26         # If the swapped user model does not support permissions, all objects
  27         # will be returned. This is taken from rules.templatetags.has_perm.
  28         return objects
  29     else:
  30         return [obj for obj in objects if user.has_perm(perm, obj)]
  31 
  32 
  33 @register.filter
  34 def percentage(value, max_value):
  35     return round(value / max_value * 100)
  36 
  37 
  38 @register.assignment_tag
  39 def project_tile_image(project):
  40     return project.tile_image or project.image or None
  41 
  42 
  43 @register.assignment_tag
  44 def project_tile_image_copyright(project):
  45     if project.tile_image:
  46         return project.tile_image_copyright
  47     elif project.image:
  48         return project.image_copyright
  49     else:
  50         return None
  51
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/meinberlin/apps/contrib/templatetags/contrib_tags.py b/meinberlin/apps/contrib/templatetags/contrib_tags.py
  --- a/meinberlin/apps/contrib/templatetags/contrib_tags.py
  +++ b/meinberlin/apps/contrib/templatetags/contrib_tags.py
  @@ -1,5 +1,8 @@
   from django import template
  +from django.forms.utils import flatatt
  +from django.template import defaultfilters
   from django.template.loader import render_to_string
  +from django.utils.safestring import mark_safe
   
   register = template.Library()
   
  @@ -48,3 +51,18 @@
           return project.image_copyright
       else:
           return None
  +
  +
  +@register.simple_tag()
  +def html_date(value, displayfmt=None, datetimefmt='c', **kwargs):
  +    """Format a date and wrap it in a html <time> element.
  +
  +    Additional html attributes may be provided as kwargs (e.g. 'class').
  +    """
  +    displaydate = defaultfilters.date(value, displayfmt)
  +    datetime = defaultfilters.date(value, datetimefmt)
  +    attribs = flatatt(kwargs)
  +    result = '<time %s datetime="%s">%s</time>' % (attribs,
  +                                                   datetime,
  +                                                   displaydate)
  +    return mark_safe(result)
  
verification_info: {"golden_diff": "diff --git a/meinberlin/apps/contrib/templatetags/contrib_tags.py b/meinberlin/apps/contrib/templatetags/contrib_tags.py\n--- a/meinberlin/apps/contrib/templatetags/contrib_tags.py\n+++ b/meinberlin/apps/contrib/templatetags/contrib_tags.py\n@@ -1,5 +1,8 @@\n from django import template\n+from django.forms.utils import flatatt\n+from django.template import defaultfilters\n from django.template.loader import render_to_string\n+from django.utils.safestring import mark_safe\n \n register = template.Library()\n \n@@ -48,3 +51,18 @@\n         return project.image_copyright\n     else:\n         return None\n+\n+\n+@register.simple_tag()\n+def html_date(value, displayfmt=None, datetimefmt='c', **kwargs):\n+    \"\"\"Format a date and wrap it in a html <time> element.\n+\n+    Additional html attributes may be provided as kwargs (e.g. 'class').\n+    \"\"\"\n+    displaydate = defaultfilters.date(value, displayfmt)\n+    datetime = defaultfilters.date(value, datetimefmt)\n+    attribs = flatatt(kwargs)\n+    result = '<time %s datetime=\"%s\">%s</time>' % (attribs,\n+                                                   datetime,\n+                                                   displaydate)\n+    return mark_safe(result)\n", "issue": "Use <time> element for dates\nThis way screen readers (and other ATs) know that it should be read as a date.\n", "before_files": [{"content": "from django import template\nfrom django.template.loader import render_to_string\n\nregister = template.Library()\n\n\n@register.assignment_tag\ndef include_template_string(template, **kwargs):\n    rendered_template = render_to_string(template, kwargs)\n    return str(rendered_template)\n\n\n@register.assignment_tag\ndef combined_url_parameter(request_query_dict, **kwargs):\n    combined_query_dict = request_query_dict.copy()\n    for key in kwargs:\n        combined_query_dict.setlist(key, [kwargs[key]])\n    encoded_parameter = '?' + combined_query_dict.urlencode()\n    return encoded_parameter\n\n\n@register.assignment_tag\ndef filter_has_perm(perm, user, objects):\n    \"\"\"Filter a list of objects based on user permissions.\"\"\"\n    if not hasattr(user, 'has_perm'):\n        # If the swapped user model does not support permissions, all objects\n        # will be returned. This is taken from rules.templatetags.has_perm.\n        return objects\n    else:\n        return [obj for obj in objects if user.has_perm(perm, obj)]\n\n\n@register.filter\ndef percentage(value, max_value):\n    return round(value / max_value * 100)\n\n\n@register.assignment_tag\ndef project_tile_image(project):\n    return project.tile_image or project.image or None\n\n\n@register.assignment_tag\ndef project_tile_image_copyright(project):\n    if project.tile_image:\n        return project.tile_image_copyright\n    elif project.image:\n        return project.image_copyright\n    else:\n        return None\n", "path": "meinberlin/apps/contrib/templatetags/contrib_tags.py"}], "after_files": [{"content": "from django import template\nfrom django.forms.utils import flatatt\nfrom django.template import defaultfilters\nfrom django.template.loader import render_to_string\nfrom django.utils.safestring import mark_safe\n\nregister = template.Library()\n\n\n@register.assignment_tag\ndef include_template_string(template, **kwargs):\n    rendered_template = render_to_string(template, kwargs)\n    return str(rendered_template)\n\n\n@register.assignment_tag\ndef combined_url_parameter(request_query_dict, **kwargs):\n    combined_query_dict = request_query_dict.copy()\n    for key in kwargs:\n        combined_query_dict.setlist(key, [kwargs[key]])\n    encoded_parameter = '?' + combined_query_dict.urlencode()\n    return encoded_parameter\n\n\n@register.assignment_tag\ndef filter_has_perm(perm, user, objects):\n    \"\"\"Filter a list of objects based on user permissions.\"\"\"\n    if not hasattr(user, 'has_perm'):\n        # If the swapped user model does not support permissions, all objects\n        # will be returned. This is taken from rules.templatetags.has_perm.\n        return objects\n    else:\n        return [obj for obj in objects if user.has_perm(perm, obj)]\n\n\n@register.filter\ndef percentage(value, max_value):\n    return round(value / max_value * 100)\n\n\n@register.assignment_tag\ndef project_tile_image(project):\n    return project.tile_image or project.image or None\n\n\n@register.assignment_tag\ndef project_tile_image_copyright(project):\n    if project.tile_image:\n        return project.tile_image_copyright\n    elif project.image:\n        return project.image_copyright\n    else:\n        return None\n\n\n@register.simple_tag()\ndef html_date(value, displayfmt=None, datetimefmt='c', **kwargs):\n    \"\"\"Format a date and wrap it in a html <time> element.\n\n    Additional html attributes may be provided as kwargs (e.g. 'class').\n    \"\"\"\n    displaydate = defaultfilters.date(value, displayfmt)\n    datetime = defaultfilters.date(value, datetimefmt)\n    attribs = flatatt(kwargs)\n    result = '<time %s datetime=\"%s\">%s</time>' % (attribs,\n                                                   datetime,\n                                                   displaydate)\n    return mark_safe(result)\n", "path": "meinberlin/apps/contrib/templatetags/contrib_tags.py"}]}