RE: Dates... again
hmmm. could you set an application/client variable, and set it to last until the time from now, until dec 21 midnight, then reset it every X hours or X minutes(once a year), or whatever, to gather the current year, and then on the year switch, trigger the other changes in the tables? tony -Original Message- From: Candace Cottrell [mailto:[EMAIL PROTECTED]] Sent: Tuesday, September 24, 2002 7:20 PM To: CF-Talk Subject: Dates... again OK, so stop the presses. Candace is stuck on dates again ;) I have a page where I want to display links for books coming out next month and through 11 months ahead. I am breaking these down by month/year using DateADD: cfscript month1 = DateFormat(DateAdd(m, +1, Now()), ); month2 = DateFormat(DateAdd(m, +2, Now()), ); month3 = DateFormat(DateAdd(m, +3, Now()), ); month4 = DateFormat(DateAdd(m, +4, Now()), ); month5 = DateFormat(DateAdd(m, +5, Now()), ); month6 = DateFormat(DateAdd(m, +6, Now()), ); month7 = DateFormat(DateAdd(m, +7, Now()), ); month8 = DateFormat(DateAdd(m, +8, Now()), ); month9 = DateFormat(DateAdd(m, +9, Now()), ); month10 = DateFormat(DateAdd(m, +10, Now()), ); month11 = DateFormat(DateAdd(m, +11, Now()), ); month12 = DateFormat(DateAdd(m, +12, Now()), ); year1 = DateFormat(DateAdd(m, +1, Now()), ); year2 = DateFormat(DateAdd(m, +2, Now()), ); year3 = DateFormat(DateAdd(m, -2, Now()), ); year4 = DateFormat(DateAdd(m, -3, Now()), ); year5 = DateFormat(DateAdd(m, -4, Now()), ); year6 = DateFormat(DateAdd(m, -5, Now()), ); year7 = DateFormat(DateAdd(m, -6, Now()), ); year8 = DateFormat(DateAdd(m, -7, Now()), ); year9 = DateFormat(DateAdd(m, -8, Now()), ); year10 = DateFormat(DateAdd(m, -9, Now()), ); year11 = DateFormat(DateAdd(m, -10, Now()), ); year12 = DateFormat(DateAdd(m, -11, Now()), ); /cfscript Would there be a way to add a separator between months that occur in 2002 and months that occur in 2003? It will also need to remove the header for 2002 once January rolls around. I have a static page that currently does this: http://209.41.188.62/books/comingSoon.cfm But I need to do this on the fly because if not, I'll have to update the template once the new year rolls around. I'd appreciate any help or suggestions :) Thanks in advance! Candace K. Cottrell, Web Developer The Children's Medical Center One Children's Plaza Dayton, OH 45404 937-641-4293 http://www.childrensdayton.org [EMAIL PROTECTED] __ Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: Dates... again
How about something like this cfloop index=offset from=1 to=11 cfoutput cfset offsetDate = DateAdd(m, offset, Now()) cfif month(offsetDate) eq 1 h1Fiction #year(offsetDate)#/h1 /cfif #DateFormat(offsetDate, )#br /cfoutput /cfloop -Original Message- From: Candace Cottrell [mailto:[EMAIL PROTECTED]] Sent: Wednesday, 25 September 2002 11:20 a.m. To: CF-Talk Subject: Dates... again OK, so stop the presses. Candace is stuck on dates again ;) I have a page where I want to display links for books coming out next month and through 11 months ahead. I am breaking these down by month/year using DateADD: cfscript month1 = DateFormat(DateAdd(m, +1, Now()), ); month2 = DateFormat(DateAdd(m, +2, Now()), ); month3 = DateFormat(DateAdd(m, +3, Now()), ); month4 = DateFormat(DateAdd(m, +4, Now()), ); month5 = DateFormat(DateAdd(m, +5, Now()), ); month6 = DateFormat(DateAdd(m, +6, Now()), ); month7 = DateFormat(DateAdd(m, +7, Now()), ); month8 = DateFormat(DateAdd(m, +8, Now()), ); month9 = DateFormat(DateAdd(m, +9, Now()), ); month10 = DateFormat(DateAdd(m, +10, Now()), ); month11 = DateFormat(DateAdd(m, +11, Now()), ); month12 = DateFormat(DateAdd(m, +12, Now()), ); year1 = DateFormat(DateAdd(m, +1, Now()), ); year2 = DateFormat(DateAdd(m, +2, Now()), ); year3 = DateFormat(DateAdd(m, -2, Now()), ); year4 = DateFormat(DateAdd(m, -3, Now()), ); year5 = DateFormat(DateAdd(m, -4, Now()), ); year6 = DateFormat(DateAdd(m, -5, Now()), ); year7 = DateFormat(DateAdd(m, -6, Now()), ); year8 = DateFormat(DateAdd(m, -7, Now()), ); year9 = DateFormat(DateAdd(m, -8, Now()), ); year10 = DateFormat(DateAdd(m, -9, Now()), ); year11 = DateFormat(DateAdd(m, -10, Now()), ); year12 = DateFormat(DateAdd(m, -11, Now()), ); /cfscript Would there be a way to add a separator between months that occur in 2002 and months that occur in 2003? It will also need to remove the header for 2002 once January rolls around. I have a static page that currently does this: http://209.41.188.62/books/comingSoon.cfm But I need to do this on the fly because if not, I'll have to update the template once the new year rolls around. I'd appreciate any help or suggestions :) Thanks in advance! Candace K. Cottrell, Web Developer The Children's Medical Center One Children's Plaza Dayton, OH 45404 937-641-4293 http://www.childrensdayton.org [EMAIL PROTECTED] __ Signup for the Fusion Authority news alert and keep up with the latest news in ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: Dates... again - Tony
I think I got you... something like... cfset changeTable = 11/30/#year1# Candace K. Cottrell, Web Developer The Children's Medical Center One Children's Plaza Dayton, OH 45404 937-641-4293 http://www.childrensdayton.org [EMAIL PROTECTED] [EMAIL PROTECTED] 09/24/02 19:29 PM hmmm. could you set an application/client variable, and set it to last until the time from now, until dec 21 midnight, then reset it every X hours or X minutes(once a year), or whatever, to gather the current year, and then on the year switch, trigger the other changes in the tables? tony -Original Message- From: Candace Cottrell [mailto:[EMAIL PROTECTED]] Sent: Tuesday, September 24, 2002 7:20 PM To: CF-Talk Subject: Dates... again OK, so stop the presses. Candace is stuck on dates again ;) I have a page where I want to display links for books coming out next month and through 11 months ahead. I am breaking these down by month/year using DateADD: cfscript month1 = DateFormat(DateAdd(m, +1, Now()), ); month2 = DateFormat(DateAdd(m, +2, Now()), ); month3 = DateFormat(DateAdd(m, +3, Now()), ); month4 = DateFormat(DateAdd(m, +4, Now()), ); month5 = DateFormat(DateAdd(m, +5, Now()), ); month6 = DateFormat(DateAdd(m, +6, Now()), ); month7 = DateFormat(DateAdd(m, +7, Now()), ); month8 = DateFormat(DateAdd(m, +8, Now()), ); month9 = DateFormat(DateAdd(m, +9, Now()), ); month10 = DateFormat(DateAdd(m, +10, Now()), ); month11 = DateFormat(DateAdd(m, +11, Now()), ); month12 = DateFormat(DateAdd(m, +12, Now()), ); year1 = DateFormat(DateAdd(m, +1, Now()), ); year2 = DateFormat(DateAdd(m, +2, Now()), ); year3 = DateFormat(DateAdd(m, -2, Now()), ); year4 = DateFormat(DateAdd(m, -3, Now()), ); year5 = DateFormat(DateAdd(m, -4, Now()), ); year6 = DateFormat(DateAdd(m, -5, Now()), ); year7 = DateFormat(DateAdd(m, -6, Now()), ); year8 = DateFormat(DateAdd(m, -7, Now()), ); year9 = DateFormat(DateAdd(m, -8, Now()), ); year10 = DateFormat(DateAdd(m, -9, Now()), ); year11 = DateFormat(DateAdd(m, -10, Now()), ); year12 = DateFormat(DateAdd(m, -11, Now()), ); /cfscript Would there be a way to add a separator between months that occur in 2002 and months that occur in 2003? It will also need to remove the header for 2002 once January rolls around. I have a static page that currently does this: http://209.41.188.62/books/comingSoon.cfm But I need to do this on the fly because if not, I'll have to update the template once the new year rolls around. I'd appreciate any help or suggestions :) Thanks in advance! Candace K. Cottrell, Web Developer The Children's Medical Center One Children's Plaza Dayton, OH 45404 937-641-4293 http://www.childrensdayton.org [EMAIL PROTECTED] __ This list and all House of Fusion resources hosted by CFHosting.com. The place for dependable ColdFusion Hosting. FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: Dates... again
I just want to be sure I am understanding this. What does offset do? I looked it up in the handy dandy WACK but didnt see anything. Candace K. Cottrell, Web Developer The Children's Medical Center One Children's Plaza Dayton, OH 45404 937-641-4293 http://www.childrensdayton.org [EMAIL PROTECTED] [EMAIL PROTECTED] 09/24/02 19:33 PM How about something like this cfloop index=offset from=1 to=11 cfoutput cfset offsetDate = DateAdd(m, offset, Now()) cfif month(offsetDate) eq 1 h1Fiction #year(offsetDate)#/h1 /cfif #DateFormat(offsetDate, )#br /cfoutput /cfloop -Original Message- From: Candace Cottrell [mailto:[EMAIL PROTECTED]] Sent: Wednesday, 25 September 2002 11:20 a.m. To: CF-Talk Subject: Dates... again OK, so stop the presses. Candace is stuck on dates again ;) I have a page where I want to display links for books coming out next month and through 11 months ahead. I am breaking these down by month/year using DateADD: cfscript month1 = DateFormat(DateAdd(m, +1, Now()), ); month2 = DateFormat(DateAdd(m, +2, Now()), ); month3 = DateFormat(DateAdd(m, +3, Now()), ); month4 = DateFormat(DateAdd(m, +4, Now()), ); month5 = DateFormat(DateAdd(m, +5, Now()), ); month6 = DateFormat(DateAdd(m, +6, Now()), ); month7 = DateFormat(DateAdd(m, +7, Now()), ); month8 = DateFormat(DateAdd(m, +8, Now()), ); month9 = DateFormat(DateAdd(m, +9, Now()), ); month10 = DateFormat(DateAdd(m, +10, Now()), ); month11 = DateFormat(DateAdd(m, +11, Now()), ); month12 = DateFormat(DateAdd(m, +12, Now()), ); year1 = DateFormat(DateAdd(m, +1, Now()), ); year2 = DateFormat(DateAdd(m, +2, Now()), ); year3 = DateFormat(DateAdd(m, -2, Now()), ); year4 = DateFormat(DateAdd(m, -3, Now()), ); year5 = DateFormat(DateAdd(m, -4, Now()), ); year6 = DateFormat(DateAdd(m, -5, Now()), ); year7 = DateFormat(DateAdd(m, -6, Now()), ); year8 = DateFormat(DateAdd(m, -7, Now()), ); year9 = DateFormat(DateAdd(m, -8, Now()), ); year10 = DateFormat(DateAdd(m, -9, Now()), ); year11 = DateFormat(DateAdd(m, -10, Now()), ); year12 = DateFormat(DateAdd(m, -11, Now()), ); /cfscript Would there be a way to add a separator between months that occur in 2002 and months that occur in 2003? It will also need to remove the header for 2002 once January rolls around. I have a static page that currently does this: http://209.41.188.62/books/comingSoon.cfm But I need to do this on the fly because if not, I'll have to update the template once the new year rolls around. I'd appreciate any help or suggestions :) Thanks in advance! Candace K. Cottrell, Web Developer The Children's Medical Center One Children's Plaza Dayton, OH 45404 937-641-4293 http://www.childrensdayton.org [EMAIL PROTECTED] __ Signup for the Fusion Authority news alert and keep up with the latest news in ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: Dates... again
I just made it up. It's a variable containing the offset in months from the current month, i.e. 1 for next month, 2 for the month after that Make sense? -Original Message- From: Candace Cottrell [mailto:[EMAIL PROTECTED]] Sent: Wednesday, 25 September 2002 11:38 a.m. To: CF-Talk Subject: RE: Dates... again I just want to be sure I am understanding this. What does offset do? I looked it up in the handy dandy WACK but didnt see anything. Candace K. Cottrell, Web Developer The Children's Medical Center One Children's Plaza Dayton, OH 45404 937-641-4293 http://www.childrensdayton.org [EMAIL PROTECTED] [EMAIL PROTECTED] 09/24/02 19:33 PM How about something like this cfloop index=offset from=1 to=11 cfoutput cfset offsetDate = DateAdd(m, offset, Now()) cfif month(offsetDate) eq 1 h1Fiction #year(offsetDate)#/h1 /cfif #DateFormat(offsetDate, )#br /cfoutput /cfloop -Original Message- From: Candace Cottrell [mailto:[EMAIL PROTECTED]] Sent: Wednesday, 25 September 2002 11:20 a.m. To: CF-Talk Subject: Dates... again OK, so stop the presses. Candace is stuck on dates again ;) I have a page where I want to display links for books coming out next month and through 11 months ahead. I am breaking these down by month/year using DateADD: cfscript month1 = DateFormat(DateAdd(m, +1, Now()), ); month2 = DateFormat(DateAdd(m, +2, Now()), ); month3 = DateFormat(DateAdd(m, +3, Now()), ); month4 = DateFormat(DateAdd(m, +4, Now()), ); month5 = DateFormat(DateAdd(m, +5, Now()), ); month6 = DateFormat(DateAdd(m, +6, Now()), ); month7 = DateFormat(DateAdd(m, +7, Now()), ); month8 = DateFormat(DateAdd(m, +8, Now()), ); month9 = DateFormat(DateAdd(m, +9, Now()), ); month10 = DateFormat(DateAdd(m, +10, Now()), ); month11 = DateFormat(DateAdd(m, +11, Now()), ); month12 = DateFormat(DateAdd(m, +12, Now()), ); year1 = DateFormat(DateAdd(m, +1, Now()), ); year2 = DateFormat(DateAdd(m, +2, Now()), ); year3 = DateFormat(DateAdd(m, -2, Now()), ); year4 = DateFormat(DateAdd(m, -3, Now()), ); year5 = DateFormat(DateAdd(m, -4, Now()), ); year6 = DateFormat(DateAdd(m, -5, Now()), ); year7 = DateFormat(DateAdd(m, -6, Now()), ); year8 = DateFormat(DateAdd(m, -7, Now()), ); year9 = DateFormat(DateAdd(m, -8, Now()), ); year10 = DateFormat(DateAdd(m, -9, Now()), ); year11 = DateFormat(DateAdd(m, -10, Now()), ); year12 = DateFormat(DateAdd(m, -11, Now()), ); /cfscript Would there be a way to add a separator between months that occur in 2002 and months that occur in 2003? It will also need to remove the header for 2002 once January rolls around. I have a static page that currently does this: http://209.41.188.62/books/comingSoon.cfm But I need to do this on the fly because if not, I'll have to update the template once the new year rolls around. I'd appreciate any help or suggestions :) Thanks in advance! Candace K. Cottrell, Web Developer The Children's Medical Center One Children's Plaza Dayton, OH 45404 937-641-4293 http://www.childrensdayton.org [EMAIL PROTECTED] __ Get the mailserver that powers this list at http://www.coolfusion.com FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: Dates... again - Matthew
oops.. ok..lol I think I understand it. And here you're saying, if the resulting month is January, print the heading. cfif month(offsetDate) eq 1 h1Fiction #year(offsetDate)#/h1 /cfif #DateFormat(offsetDate, )#br I think this will work for me. Thanks for all your help :) Candace K. Cottrell, Web Developer The Children's Medical Center One Children's Plaza Dayton, OH 45404 937-641-4293 http://www.childrensdayton.org [EMAIL PROTECTED] [EMAIL PROTECTED] 09/24/02 19:47 PM I just made it up. It's a variable containing the offset in months from the current month, i.e. 1 for next month, 2 for the month after that Make sense? -Original Message- From: Candace Cottrell [mailto:[EMAIL PROTECTED]] Sent: Wednesday, 25 September 2002 11:38 a.m. To: CF-Talk Subject: RE: Dates... again I just want to be sure I am understanding this. What does offset do? I looked it up in the handy dandy WACK but didnt see anything. Candace K. Cottrell, Web Developer The Children's Medical Center One Children's Plaza Dayton, OH 45404 937-641-4293 http://www.childrensdayton.org [EMAIL PROTECTED] [EMAIL PROTECTED] 09/24/02 19:33 PM How about something like this cfloop index=offset from=1 to=11 cfoutput cfset offsetDate = DateAdd(m, offset, Now()) cfif month(offsetDate) eq 1 h1Fiction #year(offsetDate)#/h1 /cfif #DateFormat(offsetDate, )#br /cfoutput /cfloop -Original Message- From: Candace Cottrell [mailto:[EMAIL PROTECTED]] Sent: Wednesday, 25 September 2002 11:20 a.m. To: CF-Talk Subject: Dates... again OK, so stop the presses. Candace is stuck on dates again ;) I have a page where I want to display links for books coming out next month and through 11 months ahead. I am breaking these down by month/year using DateADD: cfscript month1 = DateFormat(DateAdd(m, +1, Now()), ); month2 = DateFormat(DateAdd(m, +2, Now()), ); month3 = DateFormat(DateAdd(m, +3, Now()), ); month4 = DateFormat(DateAdd(m, +4, Now()), ); month5 = DateFormat(DateAdd(m, +5, Now()), ); month6 = DateFormat(DateAdd(m, +6, Now()), ); month7 = DateFormat(DateAdd(m, +7, Now()), ); month8 = DateFormat(DateAdd(m, +8, Now()), ); month9 = DateFormat(DateAdd(m, +9, Now()), ); month10 = DateFormat(DateAdd(m, +10, Now()), ); month11 = DateFormat(DateAdd(m, +11, Now()), ); month12 = DateFormat(DateAdd(m, +12, Now()), ); year1 = DateFormat(DateAdd(m, +1, Now()), ); year2 = DateFormat(DateAdd(m, +2, Now()), ); year3 = DateFormat(DateAdd(m, -2, Now()), ); year4 = DateFormat(DateAdd(m, -3, Now()), ); year5 = DateFormat(DateAdd(m, -4, Now()), ); year6 = DateFormat(DateAdd(m, -5, Now()), ); year7 = DateFormat(DateAdd(m, -6, Now()), ); year8 = DateFormat(DateAdd(m, -7, Now()), ); year9 = DateFormat(DateAdd(m, -8, Now()), ); year10 = DateFormat(DateAdd(m, -9, Now()), ); year11 = DateFormat(DateAdd(m, -10, Now()), ); year12 = DateFormat(DateAdd(m, -11, Now()), ); /cfscript Would there be a way to add a separator between months that occur in 2002 and months that occur in 2003? It will also need to remove the header for 2002 once January rolls around. I have a static page that currently does this: http://209.41.188.62/books/comingSoon.cfm But I need to do this on the fly because if not, I'll have to update the template once the new year rolls around. I'd appreciate any help or suggestions :) Thanks in advance! Candace K. Cottrell, Web Developer The Children's Medical Center One Children's Plaza Dayton, OH 45404 937-641-4293 http://www.childrensdayton.org [EMAIL PROTECTED] __ Get the mailserver that powers this list at http://www.coolfusion.com FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: Dates... again - Matthew
And here you're saying, if the resulting month is January, print the heading. Exactly! Let us know if you have any problems. __ This list and all House of Fusion resources hosted by CFHosting.com. The place for dependable ColdFusion Hosting. FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: Dates... again - Matthew
Ok, this works for now. I added some looping and here's waht I came up with: cfoutput cfloop index = offset from=0 to=12 cfset offsetDate = DateAdd(m, offset, Now()) cfif offsetDate eq Now() td width=43% class=nbheader Fiction #year(offsetDate)#/td/tr /cfif cfif month(offsetDate) eq 1 td width=43% class=nbheader Fiction #year(offsetDate)#/td /tr /cfif td width=43% class=copyTeal#DateFormat(offsetDate, )#/td /tr /cfloop /cfoutput http://209.41.188.62/books/comingSoon.cfm Now, I wonder if it will work for a different month than September.. hahaah Candace K. Cottrell, Web Developer The Children's Medical Center One Children's Plaza Dayton, OH 45404 937-641-4293 http://www.childrensdayton.org [EMAIL PROTECTED] [EMAIL PROTECTED] 09/24/02 20:23 PM And here you're saying, if the resulting month is January, print the heading. Exactly! Let us know if you have any problems. __ This list and all House of Fusion resources hosted by CFHosting.com. The place for dependable ColdFusion Hosting. FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: Dates... again - Matthew
cfset offsetDate = DateAdd(m, offset, Now()) cfif offsetDate eq Now() This bit might be a bit dodgy as you're assuming no time has passed between now() and now(). It could occasionally fail. It might be better to simple test if offset eq 0. __ Get the mailserver that powers this list at http://www.coolfusion.com FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists