Sharepoint List日期列格式 [英] Sharepoint List Date Column Formatting

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

问题描述

您好,我希望您度过愉快的一天。

Hello, I hope you are having a pleasant day.

我已将使用JSON的自定义格式添加到日期列。这导致时间与日期一起显示。

I have added custom formatting using JSON to a date column. This has caused the time to show along with the date.

我想要发生的事情:仅显示日期

发生了什么:日期和时间显示

我正在使用"@ currentField"确定显示的文本值。

I am using "@currentField" to determine the text value shown.

感谢您的帮助。

下面我粘贴了我的JSON:

Below I have pasted my JSON:

{
    "$schema": "http://columnformatting.sharepointpnp.com/columnFormattingSchema.json",
    "debugMode": true,
    "elmType": "div",
    "attributes": {
        "class": {
            "operator": "?",
            "operands": [
                {
                    "operator": "==",
                    "operands": [
                        {
                            "operator": "toString()",
                            "operands": [
                                "@currentField"
                            ]
                        },
                        ""
                    ]
                },
                "sp-field-severity--severeWarning",
                "sp-field-severity--low"
            ]
        }
    },
    "children": [
        {
            "elmType": "span",
            "style": {
                "display": "inline-block",
                "padding": "0 4px"
            },
            "attributes": {
                "iconName": {
                    "operator": "?",
                    "operands": [
                        {
                            "operator": "==",
                            "operands": [
                                {
                                    "operator": "toString()",
                                    "operands": [
                                        "@currentField"
                                    ]
                                },
                                ""
                            ]
                        },
                        "Warning",
                        ""
                    ]
                }
            }
        },
        {
            "elmType": "span",
            "txtContent": {
                    "operator": "?",
                    "operands": [
                        {
                            "operator": "==",
                            "operands": [
                                {
                                    "operator": "toString()",
                                    "operands": [
                                        "@currentField"
                                    ]
                                },
                                ""
                            ]
                        },
                        "NEED DATE",
                        "@currentField"
                    ]
                }
        }
    ]
}

推荐答案

嗨Josh,

尝试转到列表设置并编辑此列。选择"仅限日期"对于"日期和时间格式"选项。然后检查结果。

Try to go to list settings and edit this column. Selecting "Date Only" for "Date and Time Format" option. Then check the results.

祝你好运,

Allen Bai 

Allen Bai 


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

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