Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 2k
Upgrade d3 time format to expose new formatting options for weekdays, weeks and quarters#5026
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
29ea31d2315777e92a88cc877e722f7a14e8cabb47File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -7,7 +7,7 @@ var calComponent = require('@src/components/calendars'); | ||
| // use only the parts of world-calendars that we've imported for our tests | ||
| var calendars = require('@src/components/calendars/calendars'); | ||
| var utcFormat = require('d3').time.format.utc; | ||
| var utcFormat = require('d3-time-format').utcFormat; | ||
| describe('dates', function() { | ||
| 'use strict'; | ||
| @@ -571,15 +571,24 @@ describe('dates', function() { | ||
| ], | ||
| [ | ||
| '%B \'%y WOY:%U DOW:%w', | ||
| 'August \'12 WOY:32 DOW:1', | ||
| 'August \'12 WOY:33 DOW:1', | ||
| 'Mesori \'28 WOY:## DOW:##' // world-cals doesn't support U or w | ||
| ], | ||
| [ | ||
| '%B \'%y QOY:%q WOY:%W DOW:%u', | ||
| 'August \'12 QOY:3 WOY:33 DOW:1', | ||
| 'Mesori \'28 QOY:3 WOY:48 DOW:1' | ||
| ], | ||
| [ | ||
| 'seconds: %s and milliseconds: %Q since UNIX epoch', | ||
| 'seconds: 1344838774 and milliseconds: 1344838774567 since UNIX epoch', | ||
| 'seconds: 1344838774 and milliseconds: 1344838774567 since UNIX epoch' | ||
| ], | ||
| [ | ||
| '%c && %x && .%2f .%f', // %<n>f is our addition | ||
| 'Mon Aug 13 06:19:34 2012 && 08/13/2012 && .57 .5678', | ||
| 'Pes Meso 7 06:19:34 1728 && 12/07/1728 && .57 .5678' | ||
| '8/13/2012, 6:19:34 AM && 8/13/2012 && .57 .5678', | ||
| 'Pes Meso 7 6:19:34 AM 1728 && 12/07/1728 && .57 .5678' | ||
ContributorAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. According to https://github.com/d3/d3/blob/master/CHANGES.md#time-formats-d3-time-format varnow=newDate;d3.timeFormat("%c")(newDate);// "6/23/2016, 2:01:33 PM"d3.timeFormat("%x")(newDate);// "6/23/2016"d3.timeFormat("%X")(newDate);// "2:01:38 PM" | ||
| ] | ||
| ].forEach(function(v) { | ||
| var fmt = v[0]; | ||
| var expectedGregorian = v[1]; | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed bug reported in d3/d3-time-format#62.