prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Reduce detail level of timestamp on posts
  **Is your feature request related to a problem? Please describe.**
  I think the time when a post was posted is a tad too detailed. For posts in the last 24h, it changes every time you refresh.
  ![image](https://user-images.githubusercontent.com/66644064/116756620-b355b480-aa0c-11eb-98de-e77ec1c4b2f2.png)
  
  **Describe the solution you'd like**
  I think the firstmost unit would be enough.
  
  Also, after a few days (I suggest 3), the date (Apr 28) rather than "2 weeks(, 4 days in the current version)" seems a bit more helpful. After 1 year, the date could be shown in "Apr 2021",
  
  This is subjective of course, but imho Bookwyrm is a platform where the "when" doesn't really matter (in comparison to e.g. Mastodon where many are posting news and other stuff where the temporal context is more important). 
  
  **Describe alternatives you've considered**
  Hovering over the time could show the exact time as a tooltip. I think of this rather as an addition than an alternative and think both would complement each other.
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `bookwyrm/templatetags/status_display.py`
  Content:
  ```
  1 """ template filters """
  2 from django import template
  3 
  4 from bookwyrm import models
  5 from bookwyrm.templatetags.utilities import get_user_identifier
  6 
  7 
  8 register = template.Library()
  9 
  10 
  11 @register.filter(name="mentions")
  12 def get_mentions(status, user):
  13     """people to @ in a reply: the parent and all mentions"""
  14     mentions = set([status.user] + list(status.mention_users.all()))
  15     return (
  16         " ".join("@" + get_user_identifier(m) for m in mentions if not m == user) + " "
  17     )
  18 
  19 
  20 @register.filter(name="replies")
  21 def get_replies(status):
  22     """get all direct replies to a status"""
  23     # TODO: this limit could cause problems
  24     return models.Status.objects.filter(
  25         reply_parent=status,
  26         deleted=False,
  27     ).select_subclasses()[:10]
  28 
  29 
  30 @register.filter(name="parent")
  31 def get_parent(status):
  32     """get the reply parent for a status"""
  33     return (
  34         models.Status.objects.filter(id=status.reply_parent_id)
  35         .select_subclasses()
  36         .get()
  37     )
  38 
  39 
  40 @register.filter(name="boosted_status")
  41 def get_boosted(boost):
  42     """load a boosted status. have to do this or it won't get foreign keys"""
  43     return models.Status.objects.select_subclasses().get(id=boost.boosted_status.id)
  44
  ```
  --- 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/bookwyrm/templatetags/status_display.py b/bookwyrm/templatetags/status_display.py
  --- a/bookwyrm/templatetags/status_display.py
  +++ b/bookwyrm/templatetags/status_display.py
  @@ -1,6 +1,8 @@
   """ template filters """
  +from dateutil.relativedelta import relativedelta
   from django import template
  -
  +from django.contrib.humanize.templatetags.humanize import naturaltime, naturalday
  +from django.utils import timezone
   from bookwyrm import models
   from bookwyrm.templatetags.utilities import get_user_identifier
   
  @@ -41,3 +43,17 @@
   def get_boosted(boost):
       """load a boosted status. have to do this or it won't get foreign keys"""
       return models.Status.objects.select_subclasses().get(id=boost.boosted_status.id)
  +
  +
  +@register.filter(name="published_date")
  +def get_published_date(date):
  +    """less verbose combo of humanize filters"""
  +    if not date:
  +        return ""
  +    now = timezone.now()
  +    delta = relativedelta(now, date)
  +    if delta.years:
  +        return naturalday(date)
  +    if delta.days:
  +        return naturalday(date, "M j")
  +    return naturaltime(date)
  
verification_info: {"golden_diff": "diff --git a/bookwyrm/templatetags/status_display.py b/bookwyrm/templatetags/status_display.py\n--- a/bookwyrm/templatetags/status_display.py\n+++ b/bookwyrm/templatetags/status_display.py\n@@ -1,6 +1,8 @@\n \"\"\" template filters \"\"\"\n+from dateutil.relativedelta import relativedelta\n from django import template\n-\n+from django.contrib.humanize.templatetags.humanize import naturaltime, naturalday\n+from django.utils import timezone\n from bookwyrm import models\n from bookwyrm.templatetags.utilities import get_user_identifier\n \n@@ -41,3 +43,17 @@\n def get_boosted(boost):\n     \"\"\"load a boosted status. have to do this or it won't get foreign keys\"\"\"\n     return models.Status.objects.select_subclasses().get(id=boost.boosted_status.id)\n+\n+\n+@register.filter(name=\"published_date\")\n+def get_published_date(date):\n+    \"\"\"less verbose combo of humanize filters\"\"\"\n+    if not date:\n+        return \"\"\n+    now = timezone.now()\n+    delta = relativedelta(now, date)\n+    if delta.years:\n+        return naturalday(date)\n+    if delta.days:\n+        return naturalday(date, \"M j\")\n+    return naturaltime(date)\n", "issue": "Reduce detail level of timestamp on posts\n**Is your feature request related to a problem? Please describe.**\r\nI think the time when a post was posted is a tad too detailed. For posts in the last 24h, it changes every time you refresh.\r\n![image](https://user-images.githubusercontent.com/66644064/116756620-b355b480-aa0c-11eb-98de-e77ec1c4b2f2.png)\r\n\r\n**Describe the solution you'd like**\r\nI think the firstmost unit would be enough.\r\n\r\nAlso, after a few days (I suggest 3), the date (Apr 28) rather than \"2 weeks(, 4 days in the current version)\" seems a bit more helpful. After 1 year, the date could be shown in \"Apr 2021\",\r\n\r\nThis is subjective of course, but imho Bookwyrm is a platform where the \"when\" doesn't really matter (in comparison to e.g. Mastodon where many are posting news and other stuff where the temporal context is more important). \r\n\r\n**Describe alternatives you've considered**\r\nHovering over the time could show the exact time as a tooltip. I think of this rather as an addition than an alternative and think both would complement each other.\n", "before_files": [{"content": "\"\"\" template filters \"\"\"\nfrom django import template\n\nfrom bookwyrm import models\nfrom bookwyrm.templatetags.utilities import get_user_identifier\n\n\nregister = template.Library()\n\n\n@register.filter(name=\"mentions\")\ndef get_mentions(status, user):\n    \"\"\"people to @ in a reply: the parent and all mentions\"\"\"\n    mentions = set([status.user] + list(status.mention_users.all()))\n    return (\n        \" \".join(\"@\" + get_user_identifier(m) for m in mentions if not m == user) + \" \"\n    )\n\n\n@register.filter(name=\"replies\")\ndef get_replies(status):\n    \"\"\"get all direct replies to a status\"\"\"\n    # TODO: this limit could cause problems\n    return models.Status.objects.filter(\n        reply_parent=status,\n        deleted=False,\n    ).select_subclasses()[:10]\n\n\n@register.filter(name=\"parent\")\ndef get_parent(status):\n    \"\"\"get the reply parent for a status\"\"\"\n    return (\n        models.Status.objects.filter(id=status.reply_parent_id)\n        .select_subclasses()\n        .get()\n    )\n\n\n@register.filter(name=\"boosted_status\")\ndef get_boosted(boost):\n    \"\"\"load a boosted status. have to do this or it won't get foreign keys\"\"\"\n    return models.Status.objects.select_subclasses().get(id=boost.boosted_status.id)\n", "path": "bookwyrm/templatetags/status_display.py"}], "after_files": [{"content": "\"\"\" template filters \"\"\"\nfrom dateutil.relativedelta import relativedelta\nfrom django import template\nfrom django.contrib.humanize.templatetags.humanize import naturaltime, naturalday\nfrom django.utils import timezone\nfrom bookwyrm import models\nfrom bookwyrm.templatetags.utilities import get_user_identifier\n\n\nregister = template.Library()\n\n\n@register.filter(name=\"mentions\")\ndef get_mentions(status, user):\n    \"\"\"people to @ in a reply: the parent and all mentions\"\"\"\n    mentions = set([status.user] + list(status.mention_users.all()))\n    return (\n        \" \".join(\"@\" + get_user_identifier(m) for m in mentions if not m == user) + \" \"\n    )\n\n\n@register.filter(name=\"replies\")\ndef get_replies(status):\n    \"\"\"get all direct replies to a status\"\"\"\n    # TODO: this limit could cause problems\n    return models.Status.objects.filter(\n        reply_parent=status,\n        deleted=False,\n    ).select_subclasses()[:10]\n\n\n@register.filter(name=\"parent\")\ndef get_parent(status):\n    \"\"\"get the reply parent for a status\"\"\"\n    return (\n        models.Status.objects.filter(id=status.reply_parent_id)\n        .select_subclasses()\n        .get()\n    )\n\n\n@register.filter(name=\"boosted_status\")\ndef get_boosted(boost):\n    \"\"\"load a boosted status. have to do this or it won't get foreign keys\"\"\"\n    return models.Status.objects.select_subclasses().get(id=boost.boosted_status.id)\n\n\n@register.filter(name=\"published_date\")\ndef get_published_date(date):\n    \"\"\"less verbose combo of humanize filters\"\"\"\n    if not date:\n        return \"\"\n    now = timezone.now()\n    delta = relativedelta(now, date)\n    if delta.years:\n        return naturalday(date)\n    if delta.days:\n        return naturalday(date, \"M j\")\n    return naturaltime(date)\n", "path": "bookwyrm/templatetags/status_display.py"}]}