month, I want the last day of the month,
the same weekday, or whatever?
From: Ras Tafari
To: cf-talk
Sent: Friday, April 3, 2009 8:51:12 AM
Subject: Re: would you consider this a bug, CF8
im just saying, that BEGIN and END of month are KNOWN things...
calcu
I think the issue is just making sure the engine doesn't make the assumption
for us. If I want it to add a month to the 30th, I want the default behavior
be that it adds a month, and doesn't assume I want the end of the next
month.
Sure, another incrementer would be great for the couple of cases
im just saying, that BEGIN and END of month are KNOWN things...
calculable things.
constants if you will. why wouldnt a constant be available as a thing
i can know, the java
engine should know this... i realize i can code around it, hell i can
code around ANYTHING
but that does NOT mean its a goo
dateAdd('m', i, date1)
returns same DATE i months away. NOT same weekday, or same 3rd Thursday, or
even end of month date - just same DATE i months away.
> so, with that, id say a new incrementer of precise calendar month would be
> best.
why, when you can easily get the desired result using o
What about the start of the month? What about the second Wednesday of
each month?
This is just something for which you need to write your own code.
mxAjax / CFAjax docs and other useful articles:
http://www.bifrost.com.au/blog/
2009/4/3 Ras Tafari :
>
> but the end of months is a KNOWN thing,
but the end of months is a KNOWN thing, calculated out forever, look
at rainmain.
with that known constant of dates, it would be easy to code it such
that anything
end of month that asks for a incrementer of "m" would be easy to assume that.
so, with that, id say a new incrementer of precise cale
Definitely not odd, when you think through all the possible use cases. If I
build an auto-incrementer that takes in any start date, then I may have a July
28 start, which would indicate that 1 month out must be August 28 and one month
back must be June 28. Given that scenario, how would the un
i think it would be ok, if it was the END of the month, you know...
since if i put in 11/30
and i say, "ok, cf increment that by a month..." i cant imagine a use
case where anyone
in any industry would want it to not go to the end of December? but
yeah, a different incrementer
would be the BEST c
Still, what if you really wanted it to be the 30th? Do we really want the
engine to make this kind of assumption?
I guess the best solution would be like you said: add another incrementer.
That way we would have the option: increment by month and keep the position
relative to end of month, or inc
You will need to build into it some kludge then that if the month has
21 days, calculate it that way and so on.
I don't think ColdFusion has a "Last day of the month" function. I may
be incorrect though. I still haven't had my morning coffee.
On Thu, Apr 2, 2009 at 8:30 AM, Bert Dawson wrote:
>
Or you could start with the first, add a month, then take away a day:
#dateFormat(date2, 'mm/dd/')#
Bert
On Thu, Apr 2, 2009 at 10:15 AM, Francois Levesque wrote:
>
> That's odd, but not unexpected. Since you're starting on the 30th, it's
> adding a month to
yup, thats what francois said... works, but still odd.
tw
On Thu, Apr 2, 2009 at 11:22 AM, Ryan Stille wrote:
>
> Look at the DaysInMonth() function.
>
> -Ryan
>
> Tony wrote:
>>
>>
>>
>>
>> #dateFormat(date2,'mm/dd/'
couple things... 1. its easy as pie to code around, i was actually
doing first of next month, less 1 day... which works as well
as your idea... and thanks!
second, maybe there needs to be another incrementer, that does it
logically based on calendar month, rather than days, since
what is a month
Its not a bug infact its exactly as you specified try this instead:
#dateFormat(date2,'m/dd/')#
with a single m
here is a good reference for dateFormat:
http://www.cfquickdocs.com/cf8/#DateFormat
Paul.
On Thu, Apr 2, 2009 at 11:05 AM, Tony wrote:
>
>
>
>
Look at the DaysInMonth() function.
-Ryan
Tony wrote:
>
>
>
>
> #dateFormat(date2,'mm/dd/')#
>
>
>
> very simple code. however, its behaving like i dont want it to.
> i
That's odd, but not unexpected. Since you're starting on the 30th, it's
adding a month to that and reduces when the month doesn't have 30 days in
it. It's not taking the initiative of thinking you want the last day of the
month.
Maybe this would work?
#dateFormat(date2,'mm/dd/')#
very simple code. however, its behaving like i dont want it to.
id rather see it increment by a MONTH, not same day next month
17 matches
Mail list logo