【Microsoft Lists】日付列に月度を表す絵文字を表示してみた📆

f:id:tecchan365:20211013213419p:plain

日付にその月度を象徴するような絵文字を付けると、月度が分かりやすくなるかな?と思い、上図のような絵文字を表示する列の書式設定を作ってみました。

作成した列の書式設定の JSON を以下に掲載します。
利用する場合は、日付列の書式設定に JSON をコピー & ペーストしてください。

f:id:tecchan365:20211013213339p:plain

{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
  "elmType": "div",
  "children": [
    {
      "elmType": "span",
      "txtContent": "=if((getMonth(@currentField) + 1 ) == 1, '🎍', if((getMonth(@currentField) + 1 ) == 2, '🍫', if((getMonth(@currentField) + 1 ) == 3, '🌷', if((getMonth(@currentField) + 1 ) == 4, '🌸',  if((getMonth(@currentField) + 1 ) == 5, '🍓', if((getMonth(@currentField) + 1 ) == 6, '☔', if((getMonth(@currentField) + 1 ) == 7 , '🌻', if((getMonth(@currentField) + 1 ) == 8, '🏄', if((getMonth(@currentField) + 1 ) == 9 , '🌰', if((getMonth(@currentField) + 1 ) == 10, '🎃', if((getMonth(@currentField) + 1 ) == 11, '🍁', if((getMonth(@currentField) + 1 ) == 12, '🎅', ''))))))))))))",
      "style": {
        "font-size": "16px",
        "width": "20px",
        "text-align": "center",
        "margin-right": "8px"
      }
    },
    {
      "elmType": "span",
      "txtContent": "@currentField"
    }
  ]
}