Format Date in XSL

A

Andrew

I have 2 XSL stylesheets which both draw on data from Team Services.
The same code is included in each stylesheet to format the date using
VBScript:

=================
<msxsl:script language="VBScript" implements-prefix="user">
Function GetDate(thepasseddate)
GetDate=formatdatetime(left(thepasseddate,10),vbLongDate)
End Function
</msxsl:script>
=================

and displaying the result using:

=================
<xsl:value-of select="user:GetDate(string(tp_nDate))"/>
=================

THE PROBLEM:
============

One of them works fine, the othr one I keep getting an error page on
and I can't figure out why. I have looked at CDATA stuff and tried
shifting the code around, but it has little or similar effect.

==========
THE ERROR
==========

An unexpected error occurred.
Microsoft VBScript runtime error Type mismatch: 'formatdatetime' line
= 5, col = 2 (line is offset from the start of the script block).
Error returned from property or method call.
-2147352567
msxml3.dll

========
THE PLEA
========

Hopefully someone can help me, I am only just finding my feet with
this stuff but this one has me stumped. I cannot see any major
differences in the data that is being drawn upon in TS.

TIA

Andrew
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,817
Latest member
DicWeils

Latest Threads

Top