Comments (5)
FYI @AtishayMsft
from fluentui.
@Gabnight You can refer to the documentation https://microsoft.github.io/fluentui-charting-contrib/docs/creating-date-objects-for-chart-data to provide the date object in correct format.
In short you need to append the 'Z' literal to the date object like '2020-03-05T00:00:00.000Z'.
Any other format is considered as non standard and does not align with the x axis ticks.
Your second issue for custom date value formatting is not clear. Could you state with examples what is your expected behavior.
from fluentui.
Hello @AtishayMsft
Creating new date object without the "Z" at the end is a valid way to create date from local time zone:
Here is an exemple from the doc you mention:
Local time
All other formats (including the above date-time form of the ISO format when the time zone offset is absent) are interpreted as local time. Notice how the components in the input string don't completely match those in the output ISO string.
console.log(new Date('2010-10-10T02:10').toISOString())
// Output (IST): "2010-10-09T20:40:00.000Z"
// Output (PDT): "2010-10-10T09:10:00.000Z"
Various components can be omitted, so the following are all valid:
Date-only form: YYYY, YYYY-MM, YYYY-MM-DD
Date-time form: one of the above date-only forms, followed by T, followed by HH:mm, HH:mm:ss, or HH:mm:ss.sss. Each combination can be followed by a time zone offset.
For example, "2011-10-10" (date-only form), "2011-10-10T14:48:00" (date-time form), or "2011-10-10T14:48:00.000+09:00" (date-time form with milliseconds and time zone) are all valid date time strings.
If you prefer, new Date("2020-03-05T00:00:00.000") is equal to new Date(2020, 2, 5).
Moreover, as i explain in the bug, you can repro this issue in the react-charting demo website in the section "LineChart custom date axis locale" when you access the website in a local time zone different from UTC:
https://developer.microsoft.com/en-us/fluentui#/controls/web/linechart
For those reason, I'm reopening the issue.
Feel free to ask me more info if you need to.
from fluentui.
I'm not able to re-open the issue.
Can you re-open this issue, please?
Otherwise, I'll have to create a new issue.
from fluentui.
@Gabnight Yes, you are correct. You can create a date object without passing the 'Z' literal and it would be interpreted in the browser local time zone. Based on different timezones in browser users will see the x axis alignment shifted to left or right.
Is this what you want?
We recommend specifying the date value in UTC format so that the chart representation is uniform for users across timezones.
from fluentui.
Related Issues (20)
- [Bug] [Accessibility] [dropdown] [combobox] : TAB and Shift+TAB doesn't work properly on docsite
- colorNeutralBackgroundCard and colorNeutralBackgroundCardHover seem to be swapped.
- chore(Nav): Manual Accessibility Reivew
- [Bug]: Unexpected behavior when setting width on Data Grid body.
- [Bug]: combobox dropdown not fully visible in datagrid row/cell
- [Bug] [Accessibility] [dropdown] : Alt+arrow up doesn't work properly on docsite
- Implement color fallback to DataVizPalette
- [Bug]: [accessibility] [tagpicker] - Missing (Shift+)TAB functionality to select option from the list
- [Feature]: TagItem v8 support of data-* attributes
- [Bug]: createPresenceComponent show animation on load with react 18 strict mode
- [Bug]: [Drawer] Open and close the drawer disable scrolling on the page HOT 6
- [Bug]: calendar-compat UI bug in Teams High Contrast mode HOT 1
- [Bug]: Opening the drawer in "overlay" mode removes the scrollbar of the entire page HOT 1
- [Feature]: image/icon in RadioGroup label config to minic the react version's ChoiceGroup
- [Bug]: React testing library tests are failing intermittently after the fluent v9 update to 9.50.0 HOT 1
- [Bug]: react-charting dependency on d3 is on an old major (d3-time), causing dupes downstream HOT 1
- [feature: web-components]: Convert Checkbox to use ElementInternals
- [feature: web-components] Update Radio/RadioGroup implementation to use `ElementInternals`
- [feature: web-components] Convert Switch to use `ElementInternals`
- [Feature]: migrate repo to prettier v3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fluentui.