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 #2754

Merged
merged 1 commit into from
Mar 7, 2018

Conversation

no-reply
Copy link
Contributor

@no-reply no-reply commented Mar 2, 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 o.ne 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.

Related to #1653; backports #2741.

@samvera/hyrax-code-reviewers

@no-reply
Copy link
Contributor Author

no-reply commented Mar 2, 2018

Blocked pending #2765.

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.
@no-reply no-reply force-pushed the data-sort-backport branch from e13c474 to efc6cf3 Compare March 7, 2018 16:48
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.

👍 🎉

@no-reply no-reply merged commit e855237 into 2.0-stable Mar 7, 2018
@no-reply no-reply deleted the data-sort-backport branch March 7, 2018 17:44
no-reply pushed a commit that referenced this pull request Mar 7, 2018
Fixes date sorting on notifications and other DataTables; #1653, #2754.
@no-reply no-reply mentioned this pull request Mar 7, 2018
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