Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add data-sort attributes to dataTables rows to support date sort #2741

Merged
merged 1 commit into from
Mar 2, 2018

Conversation

no-reply
Copy link
Contributor

@no-reply no-reply commented Mar 1, 2018

Adding a data-sort with ISO 8601 datetimes allows dataTables to sort
independent of the visible row values. We continue to use javascript to generate
the human-readable time for the reasons given in #1416 (support for page
caching).

We sort to #iso8601(5) (i.e. to 5 decimal places). This still allows a
mismatch between displayed times and correctly sorted times (off by one second),
apparently due to rounding behavior in the javascript generated dates. The actual
dates sort correctly, so display dates sort themselves out (ha!) as a
notification ages past one minute.

Fixes #1653.

Changes proposed in this pull request:

  • Add high-accuracy date time stamps to datatables that need to sort on date.

@samvera/hyrax-code-reviewers

Adding a `data-sort` with ISO 8601 datetimes allows dataTables to sort
independent of the visible row values. We continue to use javascript to generate
the human-readable time for the reasons given in  #1416 (support for page
caching).

We sort to `#iso8601(5)` (i.e. to 5 decimal places). This still allows a
mismatch between displayed times and correctly sorted times (off by one second),
apparently due to rounding behavior in the javascript sort dates. The actual
dates sort correctly, so display dates sort themselves out (ha!) as a
notification ages past one minute.

Fixes #1653.
Copy link
Member

@cjcolvar cjcolvar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Thanks!

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.

2 participants