0

I have an XSLT, a tag of which returns a date. Below is the tag.

<xsl:value-of select='a:TimesheetDuration/a:Day1/a:BusinessDate'/>

The above tag gives a date in the format MM/DD/YYYY. I need to display the day (.. Like Sun, Mon, Tue...) on my page. I was going through some other answers when I found the "day-from-dateTime" method. But this seems to return the number. I need the day and also, if possible, I want to pass the above given tag to the method (.. if there is any..).. rather than storing it in a variable and passing the variable to the method. If there is a way in XSLT 1.0

Feroz
  • 351
  • 1
  • 5
  • 20
  • possible duplicate of [Get current day in week with xslt](http://stackoverflow.com/questions/15923575/get-current-day-in-week-with-xslt) –  Jul 15 '13 at 02:58
  • @torazaburo This is not a duplicate.. since the link you mentioned talks about getting the 0,1,2.. values.. I need the text Sun, Mon, Tue... Also, I actually need it in XSLT 1.0. Modifying the question now.. – Feroz Jul 15 '13 at 18:48

1 Answers1

2

In XSLT 2.0 you first have to convert the date from US to international format:

xs:date(replace(a:BusinessDate, '(..)/(..)/(....)', '$3-$1-$2'))

and then you can use

format-date($date, '[FNn,*-3]', 'en', (), ())
Michael Kay
  • 156,231
  • 11
  • 92
  • 164
  • Thanks a lot Mike.. Do we have any such functions in XSLT 1.0 since I'm using XslCompiledTransform – Feroz Jul 15 '13 at 18:36
  • These functions are specific to XSLT 2.0. There are a couple of good XSLT 2.0 processors available on .NET (Saxon and XmlPrime) - isn't it time you moved forward? – Michael Kay Jul 16 '13 at 06:27