4

How to process PublishingStartDate properly in XSLT of SharePoint 2010 Content Query web part (CQWP)?

CQWP sends e.g. Modified date of a page (row element) in format “YYYY-MM-DD…”. PublishingStartDate is, however, in local format of the site (Dutch, 1043): “DD-MM-YYYY…” I need to render value of this field in various formats, e.g. “ddwrt:FormatDateTime(string(@PublishingStartDate), 1043, 'd MMMM yyyy')", where xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime". This works properly for dates with day larger than 12 (e.g. 24th December 2012 would be rendered properly, as the function recognizes correctly what is day and what is month), but is incorrect for the others (e.g. 7-4-2012 would be rendered as 4th July instead of 7th April).

Is there an option to force the CQWP to send all dates to XSLT in English format? If not, which XSLT function would parse the text to date properly also for the local format in SharePoint 2010 (I found a few, but do not seem to work properly in SP2010)?

The parsing must be usable also in XSLT sort and server-side code is not allowed (no C#)

1 Answer 1

1

Try going to Site Settings -> Regional Settings and pick English (United Kingdom), in the "Locale" drop down.

Your Answer

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

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