FIX: Fix local-dates in non-post contexts, and in long topics (PR #14565)

  • Stop looking up the topic title from the DOM. On long topics, the topic title may not be present. Instead, we can store the topic title in a data-title attribute during decorateCookedElement, and then access it later. This approach would also allow us to add customize titles per-local-date in future. If there is no topic title available (e.g. when local dates are used elsewhere in the UI), we use the site name to build a sensible default
  • Don’t require a postId for creating calendar events. We don’t have postIds in non-post contexts. At the moment, the ‘download ICS’ function will fail without a valid postId, so that will need to be fixed in a future commit.


TIL we can use this operator in JS, cool.

Hmm good point… looks like it is a valid JS operator, but only supported in very recent versions of Safari. I don’t see any other use of it in our code, so I’ll remove this use just-in-case.

In that case, TIL we can’t yet use it.