Fix accessing timestamps when stored only as a property.

Review Request #14397 — Created April 10, 2025 and updated

Information

jquery-timesince
master

Reviewers

When jquery-timesince was first released, $.fn.attr() would look at
both attributes and properties, but this has since changed. If we have a
<time> element with datetime set as a property and not as an
attribute, it would come up empty.

This will now check the attribute first, for backwards-compatibility,
and fall back on trying to access it from the property.

Verified this fixed an issue with a manually-constructed <time> element.

Summary ID
Fix accessing timestamps when stored only as a property.
When jquery-timesince was first released, `$.fn.attr()` would look at both attributes and properties, but this has since changed. If we have a `<time>` element with `datetime` set as a property and not as an attribute, it would come up empty. This will now check the attribute first, for backwards-compatibility, and fall back on trying to access it from the property.
b336f4b6baf8f9a145824ff855b9989909489577
Description From Last Updated

Can we be consistent about quote types?

daviddavid
There are no open issues
david
  1. 
      
  2. jquery.timesince.js (Diff revision 1)
     
     
     
    Show all issues

    Can we be consistent about quote types?

  3. 
      
chipx86
Review request changed
Change Summary:

Updated an affected statement to standardize on single quotes.

Commits:
Summary ID
Fix accessing timestamps when stored only as a property.
When jquery-timesince was first released, `$.fn.attr()` would look at both attributes and properties, but this has since changed. If we have a `<time>` element with `datetime` set as a property and not as an attribute, it would come up empty. This will now check the attribute first, for backwards-compatibility, and fall back on trying to access it from the property.
c8b6e9b205c80c1f3919689731641c20da512f86
Fix accessing timestamps when stored only as a property.
When jquery-timesince was first released, `$.fn.attr()` would look at both attributes and properties, but this has since changed. If we have a `<time>` element with `datetime` set as a property and not as an attribute, it would come up empty. This will now check the attribute first, for backwards-compatibility, and fall back on trying to access it from the property.
b336f4b6baf8f9a145824ff855b9989909489577
Diff:

Revision 2 (+34 -6)

Show changes

.reviewboardrc
NEWS.md
jquery.timesince.js

Checks run (2 succeeded)

flake8 passed.
JSHint passed.
david
  1. Ship It!
  2. 
      
maubin
  1. Ship It!
  2. 
      
Loading...