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

Implemented ISO 8601 %V directive in time format #2151

Closed
wants to merge 12 commits into from
Closed

Implemented ISO 8601 %V directive in time format #2151

wants to merge 12 commits into from

Conversation

eric-poitras
Copy link

I have implemented the %V directive as defined in the documentation of strftime. It is following the ISO 8601 standard and it works for formatting and parsing. I also added tests for corner cases like the 2009 year that has 53 weeks.

Parsing note: If you parse something like this : "Fri 53 2009", it yield a date in 2010 since week 53 span over the next yea. Same thing, if you parse "Wed 01 2009", it yield a date in 2008 since week 1 start in previous year.

epoitras added 10 commits December 9, 2014 15:32
   - %V now works as expected.
   - Added tests.
   - Added tests for %W.
   - %V now works as expected.
   - Added tests.
   - Added tests for %W.
…cted.

   - Compliant to ISO 8601
   - Added tests for week 53, year rolling.
Conflicts:
	src/start.js
Conflicts:
	d3.js
	d3.min.js
	src/start.js
@eric-poitras
Copy link
Author

Hi. I was wondering if you plan to give me feedback over this pull request. We use d3 in our product and are very motivated to contribute to the project by fixing issues / adding features directly to the library when appropriate. So I signed the contributor form and I tried to follow as close a possible to the library standards. Is there additional steps I could take to make this merged in the library ? Thanks !

@zefrog
Copy link

zefrog commented May 21, 2015

👍 This would be a nice feature, as I am using ISO week numbers in tickFormat for some graphs, and starting at zero makes no sense...

@eric-poitras
Copy link
Author

Merged back master into my branch, and resolved the conflict. Had to fix the bin/component file that was referencing a non-existent attribute. Also, there is a test that fails in mbostock/master so it fail in my branch as well.

@mbostock mbostock added the req label Oct 21, 2015
@mbostock mbostock added this to the 4.0 milestone Oct 21, 2015
@mbostock
Copy link
Member

Filed d3/d3-time-format#8.

@mbostock mbostock modified the milestones: 4.0, Icebox Jul 14, 2016
@mbostock mbostock closed this Oct 20, 2016
BrianMitchL added a commit to BrianMitchL/d3-time-format that referenced this pull request Jan 23, 2017
BrianMitchL added a commit to BrianMitchL/d3-time-format that referenced this pull request Jan 24, 2017
@tdc-studio
Copy link

I am developing with d3 v4.9.1, can I ask if this very helpful feature of ISO Week numbers is available to me please? If I try and format my ticks using %V it doesn't work, unlike %W which of course does. Have I completely missed something obvious.

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

Successfully merging this pull request may close these issues.

None yet

4 participants