3

I have an issue on my display form with formatting. I have set the language and region correctly - and chosen time and date in a friendly format. When I enter the time and date it all looks fine - but when I see it in my new custom display form it appears as below:

enter image description here

How may I fix this - is there a reason for this appearing the way it does in a custom form?

I want to change the xsl in SPD - I don't want to inject more script.

<xsl:value-of select="@Other_x0020_Practioner_x0020__x0"/>

How do I change this?

2
  • For this you are used CQWB? Mar 30, 2017 at 4:32
  • How does this work?
    – garvon-77
    Mar 30, 2017 at 9:53

2 Answers 2

3

The date will save in the UTC format internally and on custom forms you have to format and show.

If you are using jQuery for your custom form, you can format as follows

(new Date("2017-03-30T13:00:00Z")).format("MM/dd/yyyy")

If not jQuery, let me know which language you are using I can provide syntax for that.

To format this in XSL you can use following syntax it worked for me.

<xsl:value-of select="ddwrt:FormatDate(@Created, 1033, 3)"/>

And refer below link for additional formats https://blogs.msdn.microsoft.com/joshuag/2009/03/25/custom-date-formats-in-sharepoint-xsl/

2
1

I finally found the details of what I needed. I looked the blog post above and it hinted at the Locale format. I need a more detailed output so I thought I would post my solution.

<xsl:value-of select="ddwrt:FormatDateTime(string(@Other_x0020_MyStuff_x0020__x0),1037, 'd/MM/yyyy h:mm:ss tt')"/>

Output example - 8/04/2017 10.24am

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.