Skip to content
This repository has been archived by the owner on Aug 27, 2019. It is now read-only.

Refactor last modified date to be rendered client side #8

Closed
kptdobe opened this issue Jun 21, 2018 · 6 comments
Closed

Refactor last modified date to be rendered client side #8

kptdobe opened this issue Jun 21, 2018 · 6 comments
Assignees

Comments

@kptdobe
Copy link
Contributor

kptdobe commented Jun 21, 2018

The last modified date is currently rendered "server" side and uses "difference" time ("Last modified xxx months ago"). Since the html is cache, the difference is wrong: it is the difference at the time of the caching and not at client rendering time.

Fixing that "issue" will allow to introduce some JS client side code and give more consistence to the project.

@kptdobe kptdobe self-assigned this Jun 21, 2018
@davidnuescheler
Copy link
Contributor

so i think that would mean that we would inline the actual last mod date and have a little javascript decoration that turns that into human readable (aka. 3 minutes ago), right?

@trieloff
Copy link
Contributor

Yes, that's the idea. Something that looks like this in the HTML: <span class="date" data-timestamp="1223782721">October 1st 1985, 5:23 pm</span> and then a small library that gets all date-classed elements and replaces their value.

@kptdobe
Copy link
Contributor Author

kptdobe commented Jun 21, 2018

Yes.
I'd like to use this opportunity to create a web project, have a dependency to moment.js... just to see what is needed.

@davidnuescheler
Copy link
Contributor

@trieloff i don't think you need the timestamp, so think the html would look something like this:

<span class="date">Thu Jun 21 2018 10:24:44 GMT-0700 (Pacific Daylight Time)</span>

@tripodsan
Copy link

I prefer @trieloff version, but I would try to follow microformat patterns:

<time datetime="2018-10-24T12:24:44-0700">
  Thu Jun 21 2018 10:24:44 GMT-0700
</time>

or

<span class="helpx-date" datetime="2018-10-24T12:24:44-0700">
  Thu Jun 21 2018 10:24:44 GMT-0700
</span>

@kptdobe
Copy link
Contributor Author

kptdobe commented Jun 28, 2018

Just merged a simple client side implementation.

@kptdobe kptdobe closed this as completed Jun 28, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants