Heya Mike,

Isn't

"isdate(parsedatetime(newsitem.pubdate.xmltext))"

a bit redundant, as if CF successfully parsed the string, it will have
turned it into a date. If you pass something that's not a date in, the
above function would throw an error.


Tuesday, November 30, 2004, 1:10:18 PM, you wrote:

MK> Someone give Darryl a prize.   Yep, you got it Darryl.  That fixed it.
MK>  At least until they change the format again.

MK> This code works:

MK> <li><cfif #isdate(parsedatetime(newsitem.pubdate.xmltext))# eq
true>>#lcase(timeformat(parsedatetime(newsitem.pubdate.xmltext),
MK> "h:mmtt"))# - </cfif><a href="#newsitem.link.xmltext#"
target="_blank">>#newsitem.title.xmltext#</a></li>

MK> The result is as follows: 

MK> 12:38pm - 'Breakthrough' on hydrogen fuel 
MK> 12:35pm - Retail spending soft in Oct 
MK> 12:25pm - Dollar drops on weak data 
MK> 12:18pm - Latham, Conroy tension brief airing 
MK> 12:12pm - Garrett returns to work 


MK> Thanks Darryl. 

MK> Mystery solved. 


MK> (although I'm still at a loss to understand why the IsDate() function
MK> doesnt return false if the contents dont seem to be a date and throws
MK> an error instead)


MK> Cheers
MK> Mike Kear
MK> Windsor, NSW, Australia
MK> AFP Webworks
MK> http://afpwebworks.com
MK> .com,.net,.org domains from AUD$20/Year




MK> On Tue, 30 Nov 2004 11:48:28 +1000, Darryl Lyons
MK> <[EMAIL PROTECTED]> wrote:
>> You sure its not throwing an error on the timeformat() now? There is no
>> parsedatetime() around the pubdate
>> 
>> Darryl
>> 
>> [EMAIL PROTECTED] wrote on 30/11/2004 11:44:34 AM:
>> 
>> 
>> 
>> > It's coming in the date field in a RSS2.0 news feed.   Until this
>> > morning it was fine,  then when i checked my site this morning I was
>> > getting this error.  So over night the newsfeed must have changed
>> > their date format.
>> >
>> > Anyway, here's the code, after parsing the XML feed:
>> >
>> > <li><cfif isdate(parsedatetime(newsitem.pubdate.xmltext))>
>> > #lcase(timeformat(newsitem.pubdate.xmltext, "h:mmtt"))# -
>> > </cfif><a href="#newsitem.link.xmltext#"
>> > target="_blank">#newsitem.title.xmltext#</a></li>
>> >
>> > So if there's a valid date, what displays is the time of day and the
>> > headline.   IF the date is not a valid date, it should display only a
>> > headline.  But it doesnt.  It throws an error.
>> >
>> > I dont want to pass the whole date in, because all i want to display
>> > is the time of day. the headlines change every few minutes so the top
>> > 5 headlines will only be on the site for a couple of hours at most.  I
>> > dont need the date there and there' s no room anyway.
>> >
>> > Sameer, it's worked fine until today, so other date formats must work
>> fine.
>> >
>> > Cheers
>> > Mike Kear
>> > AFP Webworks
>> > Windsor, NSW, Australia
>> >
>> >

MK> ---
MK> You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
MK> To unsubscribe send a blank email to [EMAIL PROTECTED]
MK> Aussie Macromedia Developers: http://lists.daemon.com.au/


-----------------------
Ryan Sabir
Newgency Pty Ltd
2a Broughton St
Paddington 2021
Sydney, Australia
Ph (02) 9331 2133
Fax (02) 9331 5199
Mobile: 0411 512 454
http://www.newgency.com/index.cfm?referer=rysig 


---
You are currently subscribed to cfaussie as: [email protected]
To unsubscribe send a blank email to [EMAIL PROTECTED]
Aussie Macromedia Developers: http://lists.daemon.com.au/

Reply via email to