drummerSupport icon indicating copy to clipboard operation
drummerSupport copied to clipboard

Incorrect Date on blog

Open am1t opened this issue 4 years ago • 34 comments

The date for the posts in the blog outliner in Drummer is displayed correctly. However, when the blog is built, it is shown as a day older.

Here is the opml file. And the blog url is this. It shows the date as Monday, October 11, 2021 while all the posts are created on October 12th.

am1t avatar Oct 12 '21 17:10 am1t

The date on the blog continues to be a day old. I wish there was a way to better understand what's going wrong -- not sure where to start looking. I suspect it possibly has something to do with the timezone. Possibly. Is there no one else who sees the issue, though?

am1t avatar Oct 13 '21 17:10 am1t

I’m sure it is the time zone thing. What time zone are you in?

scripting avatar Oct 13 '21 18:10 scripting

I’m sure it is the time zone thing. What time zone are you in?

I am in Indian Standard Time (IST) - UTC+5:30

am1t avatar Oct 13 '21 18:10 am1t

@am1t -- I'm working on it. I'll keep you posted...

scripting avatar Oct 13 '21 21:10 scripting

Just to confirm, I posted just past midnight German time, and I see it too image

scotthansonde avatar Oct 13 '21 22:10 scotthansonde

@papascott — excellent. I’ll get two people to verify the fix.

scripting avatar Oct 13 '21 22:10 scripting

@am1t and @papascott -- I have a test version ready for you to try out.

This stuff is notoriously difficult to test, so this probably will take a few iterations.

I'm going to paste in the draft docs below.

But first this is is what I want you to do.

  1. Make a few changes in your blog, over a few days, to cause the day pages for rebuild. Not for all of them, just a few.

  2. Then rebuild.

What happened?

Draft of the docs

Drummer blogs are built on a server that's in the United States' Eastern time zone.

If that's not where you're blogging from, this section is for you.

Suppose you're blogging from Indian Standard Time, which is 5 hours and 30 minutes ahead of GMT.

Add a new head-level attribute called timeZoneOffset with the value +5:30.

Then rebuild your blog.

Other values for timeZoneOffset:

  • Vancouver -8
  • Barbados -4
  • London +0
  • Accra +0
  • Berlin +1
  • Rome +1
  • Vilnius +2
  • Moscow +3
  • Ho Chi Minh +7
  • Shanghai +8
  • Honolulu -10

Here's a list of all the time zones.

scripting avatar Oct 14 '21 12:10 scripting

@scripting I am not sure that I understand what you want me to try. Do you want me to create new posts over the next few days or modify the existing posts? Also, do you want me to set the timeZoneOffset header first before trying out?

am1t avatar Oct 14 '21 12:10 am1t

@am1t -- modify existing posts. set the timeZoneOffset head att before building.

scripting avatar Oct 14 '21 12:10 scripting

I can't afford to wait four days for results. I want to get this done now. ;-)

scripting avatar Oct 14 '21 12:10 scripting

An update on the tests.

  • I modified the existing posts across the 3 days. I have posts across October 12, 13 and 14th.
  • I added the timeZoneOffset to the header.
  • I rebuilt the blog.

Here's what happened.

  1. Posts from October 12 and 13 are still shown as a day older (October 11 and 12 respectively).
  2. Posts from October 14th are shown correctly.

am1t avatar Oct 14 '21 13:10 am1t

@am1t -- that's a good sign.

Stay tuned for the next experiment. ;-)

scripting avatar Oct 14 '21 13:10 scripting

@am1t -- try rebuilding again. no need to change anything. tell me what you see.

scripting avatar Oct 14 '21 13:10 scripting

@scripting Triggered a rebuild. Nothing's changed -- the posts are still a day older as they were.

am1t avatar Oct 14 '21 13:10 am1t

stay tuned

scripting avatar Oct 14 '21 13:10 scripting

I'm following along, but you both are too fast for me! 😄 I am seeing the same results as @am1t

scotthansonde avatar Oct 14 '21 13:10 scotthansonde

Just did a hard reload and a rebuild, now the date on my test post is correct!

scotthansonde avatar Oct 14 '21 13:10 scotthansonde

Found a problem, it'll take some time to solve. So we're going to slow down for a bit. ;-)

scripting avatar Oct 14 '21 13:10 scripting

Observed the same behaviour as @papascott. A hard reload of Drummer followed by a rebuild of the blog seems to have helped. The dates are correct now.

am1t avatar Oct 14 '21 13:10 am1t

@papascott -- try a rebuild now and tell me what you see.

scripting avatar Oct 14 '21 13:10 scripting

@am1t -- I believe your site is now correct, as far as that goes. the real proof will be when the date rolls over and you publish and it shows up on the 15th, but i think the code is correct. i'm going to publish an update for the oldSchoolBlog package and post a pointer here to the code, so you all can do a code review too.

scripting avatar Oct 14 '21 13:10 scripting

FWIW setting timeZoneOffset to 0 has sorted out my uk (Scotland) site. Insomniac had caused a few post to have the wrong date. adding the timeZoneOffset and building fixed these. Thanks.

troutcolor avatar Oct 14 '21 13:10 troutcolor

I edited my test post, rebuilt the blog, and I see the correct date. 👍

On Thu, Oct 14, 2021 at 3:43 PM Dave Winer @.***> wrote:

@papascott https://github.com/papascott -- try a rebuild now and tell me what you see.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/scripting/drummerSupport/issues/64#issuecomment-943371847, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACCHNHIVGFIYQDUHLUKCSGLUG3NAZANCNFSM5F3CWEBA .

-- Scott Hanson

Email: @.*** Mobile: +49-171-5529568 Johmsweg 9a, 21266 Jesteburg, Germany

Day Job: http://www.mcdonalds-nordheide.de/

scotthansonde avatar Oct 14 '21 13:10 scotthansonde

@am1t -- I have my clueless newbie site running in your time zone, so I'll be able to check it too.

http://clueless2.lucky.wtf/

scripting avatar Oct 14 '21 14:10 scripting

There is a change note on the new head-level attribute.

scripting avatar Oct 14 '21 14:10 scripting

Here's the code in oldSchool for this feature.

https://github.com/scripting/oldSchoolBlog/blob/master/oldschool.js#L229

scripting avatar Oct 14 '21 14:10 scripting

@scripting This will break for timezones like - "UTC-3:30". There are a few locations in Canada from the list in the draft document. Basically, anything with negative offset (-) and a :30.

am1t avatar Oct 14 '21 16:10 am1t

It appears above that this timeZoneOffset already works. However, using timeZoneOffset +8 does not seem to work for my blog.opml that generates my oldschool blog. I'm not sure what I am missing.

sabre23t avatar Oct 16 '21 00:10 sabre23t

@sabre23t — I was looking at your blog.opml — the names of attributes is case sensitive, that’s why your about tab isn’t working.

http://xmlviewer.scripting.com/?url=%20http://drummer.scripting.com/sabre23t/blog.opml

scripting avatar Oct 16 '21 00:10 scripting

Thanks @scripting . I've corrected urlAboutOpml (not incorrect urlAboutOPML). Now my About tab works.

However, I can't find what I did wrong with timeZoneOffset +8. All my latest posts including "Corrected urlAboutOpml" are still shown on October 15. I tried after adding "space" to all my posts headlines to force regeneration. My current date/time is Saturday, October 16, 2021 11:40 MYT (+8).

sabre23t avatar Oct 16 '21 03:10 sabre23t