liveblog icon indicating copy to clipboard operation
liveblog copied to clipboard

nhour ago function seems wonky

Open TwoFlags opened this issue 7 years ago • 5 comments

Love this plugin. Seems to work fine, except for two minor issues:

The "nh ago" function shows an incorrect timeframe, even though the time the post was published directly below that is correct.

And there is a "false" notation beside the username slug.

Both issues show here: https://www.bossiernow.com/bossier-now-live-coverage-winter-storm-2018/

Thanks!

TwoFlags avatar Jan 15 '18 15:01 TwoFlags

Hey there, Are there any steps I can take to reproduce an incorrect timeframe? Is it showing an incorrect timeframe only for hours, or minutes too ( for example, "8 minutes ago" )?

The "false" notation appears there because you have disabled Gravatars. I created a separate ticket ( #336 ) to track that, but a quick fix would be to just enable Gravatars.

pyronaur avatar Jan 16 '18 10:01 pyronaur

Hi,

Thanks for getting back to me. It is not showing minutes, only hours — beginning with "6 hours ago" regardless of when the post was published.

Hal M. Bundrick Publisher/Editor BossierNow.com (318) 286-1997

On Tue, Jan 16, 2018 at 4:11 AM, Norris [email protected] wrote:

Hey there, Are there any steps I can take to reproduce an incorrect timeframe? Is it showing an incorrect timeframe only for hours, or minutes too ( for example, "8 minutes ago" )?

The "false" notation appears there because you have disabled Gravatars. I created a separate ticket ( #336 https://github.com/Automattic/liveblog/issues/336 ) to track that, but a quick fix would be to just enable Gravatars.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Automattic/liveblog/issues/333#issuecomment-357913464, or mute the thread https://github.com/notifications/unsubscribe-auth/Ah0SVUga3jAYfiQ1WGFh6Q7ikbtszYaTks5tLHXMgaJpZM4Rejb- .

TwoFlags avatar Jan 16 '18 12:01 TwoFlags

I managed to reproduce the problem. I'll take a look and see if there is anything I can do to help.

It looks like the function calculating how long ago something was posted isn't respecting Wordpress timezones.

pyronaur avatar Jan 17 '18 11:01 pyronaur

Thanks for pointing this out @TwoFlags!

@justnorris I have created a pull request with a fix. You were exactly right, it wasn't respecting the timezones. We have also switched to using moment.js as it makes handling things like this much easier.

liamdefty avatar Jan 17 '18 12:01 liamdefty

To me it looks like pull #340 are not fixing this issue. I am on gmt + 1 reflected in the General settings, but in order to have correct times I need to change the gmt_offset in liveblog.php to 120 instead of 60. I think the problem is with entry_time which gets its value from get_comment_date that returns the local time of the comment

gerhardsletten avatar Feb 22 '18 23:02 gerhardsletten