0

In an XSLT file, I am calling a function to a javascript file (.ascx) and trying to pass parameters. One parameter is a Date() object. The only way I've found to successfully pass it is to pass it as a string.

Here's the code from the XSLT file.

<script>
      grouping("<xsl:value-of select ="Date1"/>", <xsl:value-of select ="ID"/>);
    </script>

Here's my function in Javascript.

function grouping(date, num) 
{
     // Date is now a string instead of a Date() object
}

What I want to do is keep the date object a date object and not a string. Anyone know how to do this? Otherwise, I'll have to parse the string and make a new Date out of the substrings.

3
Contributors
2
Replies
3
Views
5 Years
Discussion Span
Last Post by Troy III
0

In an XSLT file, I am calling a function to a javascript file (.ascx) and trying to pass parameters. One parameter is a Date() object. The only way I've found to successfully pass it is to pass it as a string.

Here's the code from the XSLT file.

<script>
      grouping("<xsl:value-of select ="Date1"/>", <xsl:value-of select ="ID"/>);
    </script>

Here's my function in Javascript.

function grouping(date, num) 
{
     // Date is now a string instead of a Date() object
}

What I want to do is keep the date object a date object and not a string. Anyone know how to do this? Otherwise, I'll have to parse the string and make a new Date out of the substrings.

Use Date function instead of a Date return Date() .

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.