Fog Creek Software
Discussion Board




Knowledge Base
Documentation
Terry's Tips
Darren's Tips

Date testing

Is there a way to do a foreach loop while testing on FiledDate?

I want to publish a series of articles for events.  I decided to use filedDate as the end date of the event.  But, then i discovered I can't test for that field.  Is there another way?

I want to list all events that have not expired.  Expired events I would like to list in another page.

I'm using 2.05

Joel Goldstick
Saturday, July 12, 2003

I do this in a performance schedule:
http://tk-jk.net/euphonic/

This prints a list of events that happen today or in the future. I set the fileddate to the date of the event. It takes me about an hour to add month's worth of shows.

I do have a issue when there are multiple shows on a single day. So, I list all the shows on a single date in a same article. It would be better if my script could say: Print a show date, then all the shows for that date, print the next show date ...; but I we can't do that yet.

{$foreach x in (and(not (keyword_contains "(nonblogentry)")) (or (today) (after publishdate)))SortAscendBy .fileddate $} {$setDateTimeFormat "English" "dd/MM/yy" "hh:mm"$}

{$setDateTimeFormat "English" "ddd, dd MMMM yyyy" "hh:mm"$}{$x.fileddate$}

{$x.body$}

{$next$}


This page lists future shows at the top and the previous shows at the bottom:
http://tk-jk.net/euphonic/blog/general/Euphonicshows.html

tk
Saturday, July 12, 2003

isn't publishdate different than fileddate?  I was under the impression it is?

Joel Goldstick
Saturday, July 12, 2003

Here is the definition:
(publishDate)
Returns all articles which were filed on the publish date. This is different than today because it honors the date you specify in the Publish Dialog.

tk
Saturday, July 12, 2003

From my tests it appears that fileddate and publishdate  are the same.  I then checked the help file (duh!) and found this:

(publishDate)
Returns all articles which were filed on the publish date. This is different than today because it honors the date you specify in the Publish Dialog.

So, a reminder to those who follow my path later.. the names are different, but they reference the same date

Joel Goldstick
Saturday, July 12, 2003

Not exactly, because the publish dialog lets you specify a different date that you are publishing for.

This is helpful if, for example, you need to preview what the site is going to look like when you publish it tomorrow.

Joel Spolsky
Saturday, July 12, 2003

*  Recent Topics

*  Fog Creek Home