Skip to content

feature/ display timestamps on feed and details page - #58

Open
irenecancode wants to merge 2 commits into
mainfrom
feature/feed-datetime-display
Open

irenecancode wants to merge 2 commits into
mainfrom
feature/feed-datetime-display

Conversation

@irenecancode

@irenecancode irenecancode commented Jul 9, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Display when each sighting was posted, on both the Wildlife Feed grid cards and the sighting detail page. Previously the calendar icon next to the username rendered empty; there was no timestamp data wired up to it.
  • Format: absolute date/time as the primary text (e.g. "Jul 9, 2026, 4:09 PM"), with a relative "X ago" hint shown alongside it. Server-rendered cards use Django's humanize naturaltime filter; AJAX-loaded ("Load More") cards use a matching JS helper so both look identical.

Dependency

This PR only adds the display logic. It depends on a companion backend change (not yet submitted) that adds a created field to the feed/post API responses. Until that backend change ships, post.created will be empty and the calendar icon will still render blank -- same as today, just no regression. Nothing will look different in production from merging this alone.

Test plan

This PR only adds display logic; it has no visible effect until the companion backend PR (adds created to the API response) also merges. Testing splits into two parts:

Verifiable now, against current main (no backend change yet):

  • Load /feed/ and confirm no errors/crashes -- cards render exactly as before (calendar icon still blank, since post.created is still absent)
  • Load a sighting detail page and confirm the same — no regression from today's behavior

Requires a backend change (not yet started -- pending engineer sign-off), to add a created field to the feed/post API responses:

  • Already manually verified in dev: with a local, uncommitted backend patch adding the created field, feed cards correctly showed absolute + relative time (e.g. "Jul 9, 2026, 4:09 PM (5 hours ago)")
  • Once that backend change is approved and merged, re-verify on staging/main: feed cards and detail page both show the timestamp correctly
  • Confirm "Load More" (AJAX-loaded cards) renders the same format as the initial server-rendered cards
time and date prototype

Timestamp display shown above ("Jul 9, 2026, 4:09 PM (5 hours ago)") was captured with a local, uncommitted backend patch adding the created field included here as a preview of the intended result once the companion backend PR ships. Not reproducible against main yet.

The broken image icon is unrelated to this PR — a local-dev-only issue caused by missing GCS credentials on this machine, not something this PR introduces or fixes.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant