|
Re: Formatting Date as String in script [message #654942 is a reply to message #654858] |
Thu, 17 February 2011 17:09 |
|
You could use a text element with syntax like:
"Closed from "+ <VALUE-OF format="MMM/dd/yy"
>params["startDate"].value</VALUE-OF> + " to " + <VALUE-OF
format="MMM/dd/yy" >params["endDate"].value</VALUE-OF>
Set the text type to html.
Jason
On 2/17/2011 8:12 AM, Rick Seiden wrote:
> I have a report that takes to parameters--startDate and endDate.
>
> I want to create a single element in my report that outputs them in a
> form similar to:
>
> Closed from 1/1/2011 to 1/31/2011
>
> I'm currently using the following code to do this:
>
> "Closed from "+
> (params["startDate"].value.getMonth()+1)+"/"+params["startDate "].value.getDate()+"/"+BirtDateTime.year(params["startDate "].value)
> +
> " to "+
> (params["endDate"].value.getMonth()+1)+"/"+params["endDate "].value.getDate()+"/"+BirtDateTime.year(params["endDate"].value)
>
>
> And it works, but I'm thinking there has to be a more "graceful" way of
> doing this.
>
> Can anyone point out a better way to do this?
>
> Thanks
> Rick Seiden
|
|
|
Powered by
FUDForum. Page generated in 0.06992 seconds