Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Date field not displaying in bulletin sample #100

Closed
1 of 3 tasks
britcoco opened this issue Oct 22, 2018 · 3 comments
Closed
1 of 3 tasks

Date field not displaying in bulletin sample #100

britcoco opened this issue Oct 22, 2018 · 3 comments

Comments

@britcoco
Copy link

britcoco commented Oct 22, 2018

Category

  • Question
  • Bug
  • Enhancement

Expected or Desired Behavior

Date field not showing in bulletin board example.

Observed Behavior

I am formatting list view using this code:

{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/view-formatting.schema.json",
  "hideListHeader": true,
  "hideSelection": true,
  "rowFormatter": {
    "elmType": "button",
    "customRowAction": {
      "action": "defaultClick"
    },
    "attributes": {
      "class": "ms-bgColor-white ms-bgColor-themeLight--hover"
    },
    "style": {
      "width": "100%",
      "margin": "5px 0",
      "padding": 0,
      "border": "none",
      "cursor": "pointer"
    },
    "children": [
      {
        "elmType": "div",
        "attributes": {
          "class": "ms-borderColor-themePrimary ms-bgColor-themePrimary"
        },
        "style": {
          "min-width": "220px",
          "display": "flex",
          "border-width": "3px",
          "border-style": "solid",
          "box-sizing": "border-box",
          "align-items": "center"
        },
        "children": [
          {
            "elmType": "div",
            "attributes": {
              "iconName": "=if([$Category] == 'New Feature', 'LightningBolt', if([$Category] == 'Deployment', 'installtodrive', if([$Category] == 'Holiday', 'clearnight', if([$Category] == 'Bug Fix', 'bugsolid', 'Tag')))",
              "class": "ms-fontSize-su ms-fontWeight-regular  ms-fontColor-white",
              "title": "[$Category]"
            },
            "style": {
              "flex": "none",
              "padding": "12px",
              "padding-left": "18px",
              "height": "42px"
            }
          },
          {
            "elmType": "div",
            "style": {
              "flex-grow": "1",
              "text-align": "left",
              "max-width": "140px"
            },
            "children": [
              {
                "elmType": "div",
                "attributes": {
                  "class": "ms-fontSize-l ms-fontWeight-semibold ms-fontColor-white",
                  "title": "=toLocaleDateString([$end])"
                },
                "style": {
                  "margin-right": "12px",
                  "overflow": "hidden",
                  "white-space": "nowrap"
                },
                "txtContent": "=toLocaleDateString([$end])"
              },
              {
                "elmType": "div",
                "attributes": {
                  "class": "ms-fontSize-l ms-fontWeight-semibold ms-fontColor-white",
                  "title": "[$Category]"
                },
                "style": {
                  "margin-right": "12px",
                  "overflow": "hidden",
                  "white-space": "nowrap"
                },
                "txtContent": "[$Category]"
              }
            ]
          }
        ]
      },
      {
        "elmType": "div",
        "attributes": {
          "class": "ms-fontColor-themePrimary ms-borderColor-themePrimary ms-fontWeight-semibold ms-fontSize-l"
        },
        "style": {
          "border-width": "3px",
          "border-style": "solid",
          "box-sizing": "border-box",
          "width": "100%",
          "text-align": "left",
          "padding": "21px 12px",
          "overflow": "hidden"
        },
        "children": [
          {
            "elmType": "div",
            "txtContent": "[$Title]",
            "style": {
              "height": "24px"
            },
            "attributes": {
              "title": "[$Title]"
            }
          }
        ]
      }
    ]
  }
}

& only icon, category, and title are displayed.

Steps to Reproduce

Use above mentioned code to see if it allows date field to be visible

@thechriskent
Copy link
Contributor

Have you added the end column to your view? Only fields that are part of the view can have their values retrieved and used in your format.

@britcoco
Copy link
Author

yes end column is there as a date field

@britcoco
Copy link
Author

I just changed it to a capital E instead of lower case and seems to work now...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants