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

Less eager update notice #29

Open
msaari opened this issue Aug 5, 2018 · 0 comments
Open

Less eager update notice #29

msaari opened this issue Aug 5, 2018 · 0 comments

Comments

@msaari
Copy link

msaari commented Aug 5, 2018

"Updated on" triggers always when there's an update, because the comparison uses Unix time. This leads to cases of "Posted on 1.1.2018 (Updated on 1.1.2018)", which looks silly.

In checathlon_posted_on() (https://github.com/samikeijonen/checathlon/blob/11e27b4993118b7fa6b44dcafaa763a334b23fa7/inc/template-tags.php) changing this code

if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) { $time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time><time class="updated" datetime="%3$s">%4$s</time>'; }

to this:

if ( get_the_time( 'Y-m-d' ) !== get_the_modified_time( 'Y-m-d' ) ) { $time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time><time class="updated" datetime="%3$s">%4$s</time>'; }

would solve the issue. Since the date is displayed on day level, that's accurate enough for the comparison.

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

No branches or pull requests

1 participant