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

Using Date Field with toLocaleString() - Internet Explorer 11 Compatibility Issue #2933

Closed
phillipharding opened this issue Nov 12, 2018 · 5 comments
Labels
area:docs-comment Category: Comment left on bottom of a docs page here: https://docs.microsoft.com/sharepoint/dev area:list-formatting Category: View, row & column formatting with JSON Needs: Author Feedback Awaiting response from the original poster of the issue. Marked as stale if no activity for 7 days. no-recent-activity Stale issue due to lack of activity. Closed after 7 days with no activity by OP. type:bug-suspected Suspected bug (not working as designed/expected). See “type:bug-confirmed” for confirmed bugs.

Comments

@phillipharding
Copy link

phillipharding commented Nov 12, 2018

Using a toLocaleString() expression such as below, when viewed with IE11, "Invalid Date" is rendered for the date field, but as expected when viewed with Edge, Chrome, Safari

{
   "elmType": "div",
   "attributes": {
      "class": "ms-fontSize-s"
   },
   "style": {
      "line-height": "1.5em",
      "margin-bottom": "8px"
   },
   "txtContent": "='Modified by ' + [$Editor.title] + ', ' + toLocaleString([$Modified])"
}

Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

@KingKangMSFT KingKangMSFT added area:docs Category: SharePoint developer/development documentation related area:spfx Category: SharePoint Framework (not extensions related) labels Nov 13, 2018
@patmill patmill added area:list-formatting Category: View, row & column formatting with JSON and removed area:spfx Category: SharePoint Framework (not extensions related) labels Nov 13, 2018
@phillipharding
Copy link
Author

After further investigation, the story gets wierder and muddier

Using the Modified date field

                  {
                    "elmType": "span",
                    "txtContent": "[$Modified]"
                  }

In Chrome, Safari, Edge this works but not in IE11 which displays Invalid Date

Using a custom date field (Date & Time or just Date)

                  {
                    "elmType": "span",
                    "txtContent": "[$Contractstartdate]"
                  }

In Chrome, Safari, Edge this doesn't work displaying Invalid Date, but works in IE11

Using the Created date field

                  {
                    "elmType": "span",
                    "txtContent": "[$Created]"
                  }

In Chrome, Safari, Edge this doesn't work displaying Invalid Date, but works in IE11

The site is a Group connected site, the locale is "English - United Kingdom", and the customizer is a list view formatter, see below;

{
  "schema": "https://developer.microsoft.com/json-schemas/sp/view-formatting.schema.json",
  "hideSelection": false,
  "hideColumnHeader": true,
  "rowFormatter": {
    "elmType": "div",
    "attributes": {
      "class": "ms-borderColor-neutralLight"
    },
    "style": {
      "box-sizing": "border-box",
      "border-width": "1px",
      "border-left-width": "1px",
      "border-style": "solid",
      "border-left-color": "#107C10",
      "margin": "0 0 10px 0",
      "padding": "0 0 0 15px",
      "display": "block"
    },
    "children": [
      {
        "elmType": "span",
        "attributes": {
          "class": "ms-fontWeight-semibold"
        },
        "txtContent": "[$Title]"
      },
      {
        "elmType": "span",
        "attributes": {},
        "txtContent": "=',   Dateonlyfield:'+toString([$Dateonlyfield])"
      },
      {
        "elmType": "span",
        "attributes": {},
        "txtContent": "=',   Datetimefield:'+toString([$Datetimefield])"
      },
      {
        "elmType": "span",
        "attributes": {},
        "txtContent": "=',   Modified:'+toString([$Modified])"
      },
      {
        "elmType": "span",
        "attributes": {},
        "txtContent": "=',   Created:'+toString([$Created])"
      }
    ]
  }
}

@VesaJuvonen VesaJuvonen added the type:bug-suspected Suspected bug (not working as designed/expected). See “type:bug-confirmed” for confirmed bugs. label Dec 13, 2018
@andrewconnell andrewconnell added area:docs-comment Category: Comment left on bottom of a docs page here: https://docs.microsoft.com/sharepoint/dev and removed area:docs Category: SharePoint developer/development documentation related labels Jun 19, 2019
@andrewconnell
Copy link
Collaborator

Have you reviewed the recently published supported browsers docs here: https://support.office.com/en-us/article/Which-Browsers-Work-With-Office-Online-AD1303E0-A318-47AA-B409-D3A5EB44E452

Pay special attention to the IE11 node for the modern experience & IE's document mode.

If you continue to have the issue, please comment back with some additional context. Thanks!

@andrewconnell andrewconnell added the Needs: Author Feedback Awaiting response from the original poster of the issue. Marked as stale if no activity for 7 days. label Aug 9, 2019
@msft-github-bot msft-github-bot added the no-recent-activity Stale issue due to lack of activity. Closed after 7 days with no activity by OP. label Aug 16, 2019
@msft-github-bot
Copy link
Collaborator

This issue has been automatically marked as stale because it has marked as requiring author feedback but has not had any activity for 7 days. It will be closed if no further activity occurs within next 7 days of this comment. Thank you for your contributions to SharePoint Developer activities.

@msft-github-bot
Copy link
Collaborator

Closing issue due no response from original author. If this issue is still occurring, please open a new issue with additional details. Notice that if you have included another related issue as additional comment on this, please open that also as separate issue, so that we can track it independently.

@msft-github-bot
Copy link
Collaborator

Issues that have been closed & had no follow-up activity for at least 7 days are automatically locked. Please refer to our wiki for more details, including how to remediate this action if you feel this was done prematurely or in error: Issue List: Our approach to locked issues

@SharePoint SharePoint locked as resolved and limited conversation to collaborators Jan 26, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area:docs-comment Category: Comment left on bottom of a docs page here: https://docs.microsoft.com/sharepoint/dev area:list-formatting Category: View, row & column formatting with JSON Needs: Author Feedback Awaiting response from the original poster of the issue. Marked as stale if no activity for 7 days. no-recent-activity Stale issue due to lack of activity. Closed after 7 days with no activity by OP. type:bug-suspected Suspected bug (not working as designed/expected). See “type:bug-confirmed” for confirmed bugs.
Projects
None yet
Development

No branches or pull requests

6 participants