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

Year support for "10000" #123

Open
I563099 opened this issue Oct 31, 2023 · 2 comments
Open

Year support for "10000" #123

I563099 opened this issue Oct 31, 2023 · 2 comments

Comments

@I563099
Copy link

I563099 commented Oct 31, 2023

In the file-"d3.js", Method-"format.parse" and line-if (i != string.length) return null;
Year is supported only till "9999"(string.length=14) if year "10000" is passed then it is returning as null because length will be increased by 1(string.length=15).
Is it a technical restriction or is there any other way forward to handle such scenarios ?

@mbostock mbostock transferred this issue from d3/d3 Nov 5, 2023
@mbostock
Copy link
Member

mbostock commented Nov 5, 2023

The %Y specifier is defined as a four-digit year so that you can do things like %Y%m%d and parse digits with no separator.

d3.utcParse("%Y%m%d")("20200101") // 2020-01-01T00:00:00.000Z

If we want to parse variable-digit years then we would need a different specifier.

@I563099
Copy link
Author

I563099 commented Nov 7, 2023

The version of D3 we are using is - D3 v3.4.12 - http://d3js.org/

Sample example: https://jsbin.com/rubufenida/edit?html,js,console,output

Is there any specifier which we can use for year "10000" as specified in above sample? Because we didn't find any in - https://observablehq.com/@bumbeishvili/d3-timeformat-playground

If not what is the alternative which we can use.
Please let us know.

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

No branches or pull requests

2 participants