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

List Formatting - Different dates are returned by the getDate operator depending on the time zone of the computer #9618

Open
2 of 9 tasks
tecchan1107 opened this issue Apr 4, 2024 · 1 comment
Labels
Needs: Triage 🔍 Awaiting categorization and initial review. type:bug-suspected Suspected bug (not working as designed/expected). See “type:bug-confirmed” for confirmed bugs.

Comments

@tecchan1107
Copy link
Contributor

Target SharePoint environment

SharePoint Online

What SharePoint development model, framework, SDK or API is this about?

Declarative list formatting

Developer environment

Windows

What browser(s) / client(s) have you tested

  • 💥 Internet Explorer
  • 💥 Microsoft Edge
  • 💥 Google Chrome
  • 💥 FireFox
  • 💥 Safari
  • mobile (iOS/iPadOS)
  • mobile (Android)
  • not applicable
  • other (enter in the "Additional environment details" area below)

Additional environment details

No response

Describe the bug / error

I have observed that changing the time zone of the computer changes the value retrieved by the getDate operator and also retrieves a different value than the date in the date column.

image

Related Document: Formatting syntax reference

Steps to reproduce

Setting up a list for verification

  1. Create a date column with the internal name Date in the list
  2. Set any date in the column created in step 1
  3. Create a column to display the values retrieved by the getDate operator
  4. Set the following JSON to the column formatting created in step 3
{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
  "elmType": "div",
  "txtContent": "=getDate([$Date])"
}

image

Change computer time zone

  1. Change computer time zone from UTC+09:00 to UTC-09:00
    image

  2. When the list is reopened, the value obtained with the getDate operator is not the same as before the time zone change, and is different from the date in the date column
    image

Expected behavior

The getDate operator returns the date of the referencing date sequence without being affected by the computer's time zone.

@tecchan1107 tecchan1107 added the type:bug-suspected Suspected bug (not working as designed/expected). See “type:bug-confirmed” for confirmed bugs. label Apr 4, 2024
@tecchan1107
Copy link
Contributor Author

For reference, I also send a screenshot of the time zone setting for the site.

image

@VesaJuvonen VesaJuvonen added the Needs: Triage 🔍 Awaiting categorization and initial review. label Jun 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs: Triage 🔍 Awaiting categorization and initial review. 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

2 participants