格式化日期(Sharepoint 设计器) [英] Formatting a Date (Sharepoint Designer)

查看:38
本文介绍了格式化日期(Sharepoint 设计器)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在 Sharepoint Designer 中正确设置日期格式.

I am trying to format the dates correctly in Sharepoint Designer.

这行代码确实有效,但我得到的结果是虚假的,因为我的日期是英国格式.

This line of code does work but I am getting spurious results as my dates are in UK formatting.

<xsl:value-of
      select=
"number(ddwrt:DateTimeTick(
            ddwrt:GenDisplayName(string(FormatDate(@DateSent,2057,1)))))-
 number(ddwrt:DateTimeTick(
            ddwrt:GenDisplayName(string(FormatDate(ddwrt:Today(),2057,1)))))"
/>

我得到的错误是:

FormatDate is not a valid XSLT or XPath function.

提前致谢.

推荐答案

XPath 标准中没有函数 FormatDate(...).Sharepoint Designer 有一个位于您用于其他一些功能的 ddwrt: 命名空间中.要调用它,请添加命名空间.

There is no function FormatDate(...) in the XPath standard. Sharepoint Designer has one which is in the ddwrt: namespace you used for some other functions. For calling this, add the namespace.

number(ddwrt:DateTimeTick(ddwrt:GenDisplayName(string(ddwrt:FormatDate(string(@DateSent,2057,1))))))
-
number(ddwrt:DateTimeTick(ddwrt:GenDisplayName(string(ddwrt:FormatDate(ddwrt:Today(),2057,1)))))"

这篇关于格式化日期(Sharepoint 设计器)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆