开发者

Change date format in Sharepoint template

Using SharePoint 2007, I downloaded Microsoft's Employee's Training Scheduling and Materials template from http://www.microsoft.com/downloads/details.aspx?FamilyId=B5206277-550C-44DA-A2D5-D7E32E3B6B8F

This is exactly what I wanted but the date format for Start/End date is in the format "MM/dd/yyyy" (US). I want it in "dd/MM/yyyy" (UK) but cannot for the life of me find where I can change this simple detail. Any advice?

EDIT: I have found the offending piece of code:

<SharePoint:FormField runat="server" id="ff7{$Pos}" ControlMode="New" FieldName="EventDate" __designer:bind="{ddwrt:DataBind('i',concat('ff7',$Pos),'Value','ValueChanged','ID',ddwrt:EscapeDelims(string(@ID)),'@EventDate')}"/>

But I can't seem to see how the date would be formatted. The exact same piece of code is used elsewhere (differen开发者_开发技巧t id and a pre-installed template) and displays the date correctly.

EDIT: OK Still having problems with this. When I Edit Items the dates are formatted correctly, but when it is displaying the dates they are displayed incorrectly. Any ideas?

Correct:

Change date format in Sharepoint template

Incorrect:

Change date format in Sharepoint template


If you edit that offending piece of code then add a LocaleId="2057" if @Ryans solution does not work for you. I had the similar situation before and adding that worked for me

ie

<SharePoint:FormField runat="server" id="ff7{$Pos}" LocaleId="2057" ControlMode="New" FieldName="EventDate" __designer:bind=" ddwrt:DataBind('i',concat('ff7',$Pos),'Value','ValueChanged','ID',ddwrt:EscapeDelims(string(@ID)),'@EventDate')}"/>


Generally the date format is defined by the site regional settings and not hard coded into any template.

Have you checked Site Actions > Site Settings > Regional Settings > Locale ?


I consider you want to display list items with date format. You can create a Custom Display Form. In that add the Custom List Form. In custom form there comes the option for choosing date.

I think this is helpful.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜