Я применил форматирование представления, а также форматирование столбцов, используя JSON, к ряду представлений в списке, которые отображают вычисляемые столбцы, возвращающие тип данных, дату и время. Даты правильно отображались в пользовательских форматированных представлениях в течение нескольких недель, пока совсем недавно он не перестал работать. Даты теперь отображаются в американском формате или как недействительные, даже если в настройках локали на сайте установлено значение UK.
Не совсем уверен, что могло вызвать проблему. Я был бы очень признателен за помощь.
Заранее спасибо.
Расчетный столбец (крайний срок стадии A&R):
= ([Общее количество дней остановки часов] + [Дата начала SAR ] +27)
Тип данных: Дата и время Формат даты и времени: Только дата
{
"schema": "https://developer.microsoft.com/json-schemas/sp/view-formatting.schema.json",
"hideSelection": true,
"hideColumnHeader": true,
"rowFormatter": {
"elmType": "div",
"attributes": {
"class": "ms-borderColor-neutralLight"
},
"style": {
"width": "65%",
"flex-direction": "column",
"align-items": "stretch",
"box-sizing": "border-box",
"border-width": "1px",
"border-style": "solid",
"margin-bottom": "10px"
},
"children": [
{
"elmType": "div",
"style": {
"display": "flex",
"flex-wrap": "wrap",
"align-items": "center",
"box-sizing": "border-box"
},
"children": [
{
"elmType": "div",
"style": {
"flex": " 1 0 300px"
},
"children": [
{
"elmType": "div",
"style": {},
"children": [
{
"elmType": "div",
"attributes": {
"class": "ms-font-xl"
},
"style": {
"line-height": "1.5em",
"color": "Green",
"margin": "10px 0",
"padding": "0 20px"
},
"txtContent": "[$Title]"
},
{
"elmType": "div",
"attributes": {
"class": "ms-fontSize-sPlus"
},
"style": {
"line-height": "1.5em",
"margin": "8px 0"
},
"children": [
{
"elmType": "div",
"style": {
"display": "inline-block"
},
"children": [
{
"elmType": "span",
"attributes": {
"class": "ms-fontWeight-semibold"
},
"style": {
"display": "inline-block",
"margin-right": "18px",
"padding": "0 20px"
},
"txtContent": "Data Subject:"
},
{
"elmType": "span",
"style": {
"display": "block",
"padding": "8px 20px"
},
"txtContent": "[$Data_x0020_subject]"
}
]
}
]
},
{
"elmType": "div",
"attributes": {
"class": "ms-fontSize-sPlus"
},
"style": {
"line-height": "1em",
"margin": "8px 0"
},
"children": [
{
"elmType": "div",
"style": {
"display": "inline-block"
},
"children": [
{
"elmType": "span",
"attributes": {
"class": "ms-fontWeight-semibold"
},
"style": {
"display": "inline-block",
"margin-right": "18px",
"padding": "0 20px"
},
"txtContent": "Academy:"
},
{
"elmType": "span",
"style": {
"display": "block",
"padding": "8px 20px"
},
"txtContent": "[$Academy.lookupValue]"
}
]
}
]
},
{
"elmType": "div",
"attributes": {
"class": "ms-fontSize-sPlus"
},
"style": {
"line-height": "1em",
"margin": "8px 0"
},
"children": [
{
"elmType": "div",
"style": {
"display": "inline-block"
},
"children": [
{
"elmType": "span",
"attributes": {
"class": "ms-fontWeight-semibold"
},
"style": {
"display": "inline-block",
"margin-right": "18px",
"padding": "0 20px"
},
"txtContent": "Additional SAR Managers:"
},
{
"elmType": "span",
"style": {
"display": "block",
"padding": "8px 20px"
},
"txtContent": "[$Additional_x0020_SAR_x0020_Manag.title]"
}
]
}
]
}
]
},
{
"elmType": "div",
"style": {
"flex": "0 0 170px",
"display": "flex",
"flex-direction": "row"
},
"children": [
{
"elmType": "button",
"customRowAction": {
"action": "editProps"
},
"txtContent": "Edit/ View",
"attributes": {
"class": "ms-fontColor-themePrimary ms-fontColor-themeDarker--hover"
},
"style": {
"color": "Green",
"width": "100px",
"height": "32px",
"margin": "20px 0 10px 5px"
}
},
{
"elmType": "button",
"customRowAction": {
"action": "executeFlow",
"actionParams": "{\"id\": \"aac77602-dead-438c-b85d-d4e93fb27efc\"}"
},
"txtContent": "Complete Stage",
"attributes": {
"class": "ms-fontColor-themePrimary ms-fontColor-themeDarker--hover"
},
"style": {
"color": "Green",
"width": "145px",
"height": "32px",
"margin": "20px 0 10px 5px",
"display": "=if([$A_x0026_R_x0020_Status] != 'Completed', '', 'none')"
}
},
{
"elmType": "button",
"customRowAction": {
"action": "executeFlow",
"actionParams": "{\"id\": \"6621b694-3fd4-48b3-9586-7b5250397efe\"}"
},
"txtContent": "Stop the Clock",
"attributes": {
"class": "ms-fontColor-themePrimary ms-fontColor-themeDarker--hover"
},
"style": {
"color": "Green",
"width": "145px",
"height": "32px",
"margin": "20px 0 10px 5px",
"display": "=if([$Clock_x0020_Stopped] == 'No', '', 'none')"
}
},
{
"elmType": "button",
"customRowAction": {
"action": "executeFlow",
"actionParams": "{\"id\": \"d910384c-3f50-4a1d-a53c-47d9a94c3ada\"}"
},
"txtContent": "Start the Clock",
"attributes": {
"class": "ms-fontColor-themePrimary ms-fontColor-themeDarker--hover"
},
"style": {
"color": "Green",
"width": "145px",
"height": "32px",
"margin": "20px 0 10px 5px",
"display": "=if([$Clock_x0020_Stopped] == 'Yes', '', 'none')"
}
},
{
"elmType": "button",
"customRowAction": {
"action": "executeFlow",
"actionParams": "{\"id\": \"d9cbbb5b-54d1-498a-a25d-e9cb072ea696\"}"
},
"txtContent": "Cancel/ Withdraw",
"attributes": {
"class": "ms-fontColor-themePrimary ms-fontColor-themeDarker--hover"
},
"style": {
"color": "Green",
"width": "145px",
"height": "32px",
"margin": "20px 0 10px 5px"
}
}
]
}
]
},
{
"elmType": "div",
"attributes": {
"class": "ms-fontSize-sPlus ms-bgColor-neutralLighter"
},
"style": {
"padding": "25px 20px",
"line-height": "1.4em",
"flex-direction": "row",
"justify-content": "space-between"
},
"children": [
{
"elmType": "div",
"style": {},
"children": [
{
"elmType": "span",
"attributes": {
"class": "ms-fontWeight-semibold"
},
"txtContent": "A&R Start Date: "
},
{
"elmType": "span",
"style": {
"display": "inline-block"
},
"txtContent": "=toLocaleDateString([$A_x0026_R_x0020_Start_x0020_Date])"
}
]
},
{
"elmType": "div",
"children": [
{
"elmType": "span",
"attributes": {
"class": "ms-fontWeight-semibold"
},
"txtContent": "A&R Deadline: "
},
{
"elmType": "span",
"style": {
"display": "inline-block",
"color": "=if([$A_x0026_R_x0020_stage_x0020_dead] <= @now, 'Red', '')"
},
"txtContent": "=toLocaleDateString([$A_x0026_R_x0020_stage_x0020_dead])"
}
]
},
{
"elmType": "div",
"style": {
"margin": "0 0px"
},
"children": [
{
"elmType": "span",
"attributes": {
"class": "ms-fontWeight-semibold"
},
"txtContent": "SAR Deadline: "
},
{
"elmType": "span",
"style": {
"display": "inline-block"
},
"txtContent": "[$Due_x0020_Date]"
}
]
},
{
"elmType": "div",
"style": {
"margin": "0 0px"
},
"children": [
{
"elmType": "span",
"attributes": {
"class": "ms-fontWeight-semibold"
},
"txtContent": "Clock Stopped: "
},
{
"elmType": "span",
"style": {
"display": "inline-block",
"color": "=if([$Clock_x0020_Stopped] == 'Yes', 'Red', 'Green')"
},
"txtContent": "[$Clock_x0020_Stopped]"
}
]
}
]
}
]
}
]
}
}