Fog Creek Software
Discussion Board




Knowledge Base
Documentation
Terry's Tips
Darren's Tips

2.0.1 publish date problem?

Is it my mistake? I think this worked just fine in CityDesk 1x.

This should publish articles with a publish date for today or in the future. In order to get this to work in 2.0.1 I have to set the publish date to yesterday. If I publish for today it skips articles dated today and starts articles dated tomorrow.

(John C. may rocognize this script)

<P>{$foreach&nbsp;x in (and(not (keyword_contains "(nonblogentry)")) (or (today) (after publishdate)))SortAscendBy .fileddate $} {$setDateTimeFormat "English" "dd/MM/yy" "hh:mm"$}</P>
<P class=articleHeader><A href="{$x.link$}"><SPAN><IMG height=15 alt="Permanent link to archive for {$x.fileddate$}." hspace=4 src="PTMFOG0000000028.gif" width=12 align=right border=0></SPAN></A><A class=emphasis>{$setDateTimeFormat "English" "ddd, dd MMMM yyyy" "hh:mm"$}{$x.fileddate$}</A></P>{$x.body$}
<P>&nbsp;</P>
<P>{$next$}</P>

tk
Wednesday, May 14, 2003

Curious. I'm assuming that's from the simple weblog template from my site. When I put your code in and have one article, called 'today' with a publish date of today, then only that article is shown. But adding a new article, 'tomorrow' dated tomorrow removes the 'today' one and only shows the tomorrow one.

It seems to me as if the (or (today)(after publishdate) ) might not be doing the right thing.  Surely it should show both the 'today' and 'tomorrow' articles given that one is dated today and the other is dated after the publish date (which is also today).

Sounds like a bug to me.

John C
Wednesday, May 14, 2003

John, it is certainly your blog template (thanks again) sorted upside down. I've reported the problem.

What made it harder to deal with is that my site has a very long preview/publish and I can't set a publish date when I want to preview a single article.

I'm finding (I'll check this tomorrow) that when I publish, I have to set the publish date two days earlier than today's date in order to pick up articles dated today.

tk
Wednesday, May 14, 2003

I haven't even looked at it, but I noticed this:

$foreach&nbsp;x in

Shouldn't that be $foreach x in .... you have a nonbreaking space instead of a real space. Maybe you copied from normal view instead of code view?

www.marktaw.com
Wednesday, May 14, 2003

We did change some of the code to do with dates, etc. because the user interface now allows you to enter exact times. I haven't looked closely at your bug I will as soon as I get a chance.

BTW the &nbsp; in the CityScript is converted to a real space before compiling, so it won't hurt.

Joel Spolsky
Wednesday, May 14, 2003

Thanks Joel and Mark, I just removed the "&nbsp;" and get the same result. Publishing for today starts with tomorrow's article.

I can deal with it for the time being and feel a little better knowing that I may not have lost all of my mind after all.  Tomorrow's another day though.

tk
Wednesday, May 14, 2003

After another publish, it seems like "today" really means "today + 2"

So in order to publish today's articles for 5-16 I have to publish for 5-14.

tk
Friday, May 16, 2003

I just fixed this -- genuine bug, introduced when we added times to the user interface.

It'll be fixed in the next beta.

Joel Spolsky
Monday, May 19, 2003

*  Recent Topics

*  Fog Creek Home