Skip to content

use UTC milliseconds for internal representation of dates #1172

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

Closed
wants to merge 64 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
e5916c4
update changelog for 1.20.0
etpinard Nov 15, 2016
d48c310
1.20.0
etpinard Nov 15, 2016
fcd9547
remove commented out code about 3d pie chart attributes
alexcjohnson Nov 15, 2016
e94b1d1
Merge pull request #1152 from plotly/no-3d-pies
alexcjohnson Nov 16, 2016
9583cfa
annotation: assign dflt pos if category IS NOT present
etpinard Nov 16, 2016
6e7d5d6
test: add annotations to mock 16
etpinard Nov 16, 2016
58b91e7
test: add annotation with category positions case
etpinard Nov 16, 2016
ca2e112
Merge pull request #1155 from plotly/annotation-category-fix
etpinard Nov 16, 2016
2204914
update changelog for 1.20.1
etpinard Nov 16, 2016
564f661
1.20.1
etpinard Nov 16, 2016
d7de2ae
issue #1160 fix
adamborowski Nov 17, 2016
665e56c
modebar: use axis r21 and l2r to compute zoom +/- ranges
etpinard Nov 17, 2016
8e9d458
test: test all cartesian axis types in modebar click cases
etpinard Nov 17, 2016
c45338d
test: use ax.r2l to assert range
etpinard Nov 17, 2016
8472254
bar: fix wrong bar size in hover labels
n-riesco Nov 17, 2016
1c32bc5
Merge pull request #1163 from n-riesco/pr-20161117-fix-issue-1157
etpinard Nov 17, 2016
f1b686f
test: assert up to yyyy-mm-dd for date ranges
etpinard Nov 17, 2016
4d9b02d
Merge pull request #1162 from plotly/modebar-date-zoom-fix
etpinard Nov 17, 2016
9e71209
update changelog for 1.20.2
etpinard Nov 17, 2016
775682f
1.20.2
etpinard Nov 17, 2016
6cf4283
tasks: fixup main bundle URLs
etpinard Nov 18, 2016
5971c16
Merge pull request #1166 from plotly/stats-fixup
etpinard Nov 18, 2016
fb44aee
fixing the non-fancy scattergl 'single data point' infinite loop
monfera Nov 18, 2016
bd34ec2
use UTC milliseconds for internal representation of dates
alexcjohnson Nov 19, 2016
9c645e7
if it works in Alaska it'll work anywhere.
alexcjohnson Nov 19, 2016
6d83c7b
verify our test environment has DST
alexcjohnson Nov 19, 2016
02e98a9
fix range selectors for UTC, and tests to run in arbitrary timezone
alexcjohnson Nov 19, 2016
c41a0b4
lint
alexcjohnson Nov 19, 2016
94f4d5f
test case for scattergl single data point
monfera Nov 19, 2016
fb0ff70
Merge pull request #1168 from monfera/scattergl-with-one-datapoint
etpinard Nov 21, 2016
1058366
Clone input trace
dy Nov 11, 2016
ea8ce86
Ignore line ending style
dy Nov 11, 2016
fa18648
Fix typo
dy Nov 11, 2016
ecd795a
test: add case for addTraces with exising data/traces
etpinard Nov 21, 2016
7e4c5c1
lint
etpinard Nov 21, 2016
6d2f655
Add check for failed binding comparison
rreusser Nov 21, 2016
6dc01d6
Make 'is simple binding' false for non-length-one arrays
rreusser Nov 21, 2016
125770b
Merge pull request #1175 from plotly/pr1136-clone-trace
etpinard Nov 21, 2016
242f3b4
Add test for non-present command arg value
rreusser Nov 21, 2016
218744d
Fix command api test that doesn't actually test anything
rreusser Nov 21, 2016
62c95f8
test: add jasmine test for #1169
etpinard Nov 21, 2016
63f455d
Merge pull request #1176 from plotly/fix-command-api-bug
etpinard Nov 21, 2016
a23a460
update changelog for 1.20.3
etpinard Nov 21, 2016
d9caee9
1.20.3
etpinard Nov 21, 2016
744041b
schema: fix defs.metaKeys field
etpinard Nov 21, 2016
bfba27d
Merge pull request #1182 from plotly/schema-metakey-fix
etpinard Nov 21, 2016
318fc48
update changelog for 1.20.4
etpinard Nov 21, 2016
48b0358
1.20.4
etpinard Nov 21, 2016
5f98edd
fix regression in lib/clean_number (alternate)
etpinard Nov 21, 2016
79fe7d5
turn front/end/global regex's into 1
etpinard Nov 21, 2016
b4da924
fix for date histograms with uniform bins
alexcjohnson Nov 22, 2016
2a57525
temp fix for histogram2d test in UTC environment
alexcjohnson Nov 22, 2016
846f2c7
Merge pull request #1185 from plotly/clean-datum-regression-alt
etpinard Nov 22, 2016
c130932
Merge pull request #1186 from plotly/fix-date-histograms
alexcjohnson Nov 22, 2016
426077a
handle and test a bunch of tickvals / ticktext edge cases
alexcjohnson Nov 22, 2016
27fb4b1
tighter test for when to remove seconds from date tick text
alexcjohnson Nov 22, 2016
74da7a4
include test that we didn't add any categories to category tickvals test
alexcjohnson Nov 22, 2016
77f745e
fix log axes tickvals default text formatting bug
alexcjohnson Nov 22, 2016
6762130
remove old (buggy) hovertext cruft, clean up and test edge cases
alexcjohnson Nov 23, 2016
c70f04a
suffix -> dateHead / headPart
alexcjohnson Nov 23, 2016
bd24421
Merge pull request #1191 from plotly/tickvals-edge-cases
alexcjohnson Nov 23, 2016
f35313a
update changelog for 1.20.5
etpinard Nov 23, 2016
0fc37d6
1.20.5
etpinard Nov 23, 2016
cd73020
Merge branch 'master' into dates-utc-backend
alexcjohnson Nov 23, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/components/rangeselector/get_update_object.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ function getXRange(axisLayout, buttonLayout) {

switch(buttonLayout.stepmode) {
case 'backward':
range0 = Lib.ms2DateTime(+d3.time[step].offset(base, -count));
range0 = Lib.ms2DateTime(+d3.time[step].utc.offset(base, -count));
break;

case 'todate':
var base2 = d3.time[step].offset(base, -count);
var base2 = d3.time[step].utc.offset(base, -count);

range0 = Lib.ms2DateTime(+d3.time[step].ceil(base2));
range0 = Lib.ms2DateTime(+d3.time[step].utc.ceil(base2));
break;
}

Expand Down
1 change: 1 addition & 0 deletions src/lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ var datesModule = require('./dates');
lib.dateTime2ms = datesModule.dateTime2ms;
lib.isDateTime = datesModule.isDateTime;
lib.ms2DateTime = datesModule.ms2DateTime;
lib.ms2DateTimeLocal = datesModule.ms2DateTimeLocal;
lib.cleanDate = datesModule.cleanDate;
lib.isJSDate = datesModule.isJSDate;
lib.MIN_MS = datesModule.MIN_MS;
Expand Down
5 changes: 4 additions & 1 deletion test/jasmine/tests/annotations_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,10 @@ describe('Test annotations', function() {
axref: 'x',
ayref: 'y',
x: '2008-07-01',
ax: Dates.dateTime2ms('2004-07-01'),
// note this is not portable: this generates ms in the local
// timezone, so will work correctly where it was created but
// not if the milliseconds number is moved to another TZ
ax: +(new Date(2004, 6, 1)),
y: 0,
ay: 50
}]
Expand Down
2 changes: 1 addition & 1 deletion test/jasmine/tests/axes_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -678,7 +678,7 @@ describe('Test axes', function() {

it('should handle tick0 and dtick for date axes', function() {
var someMs = 123456789,
someMsDate = Lib.ms2DateTime(someMs),
someMsDate = Lib.ms2DateTimeLocal(someMs),
oneDay = 24 * 3600 * 1000,
axIn = {tick0: someMs, dtick: String(3 * oneDay)},
axOut = {};
Expand Down
2 changes: 1 addition & 1 deletion test/jasmine/tests/shapes_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ describe('Test shapes', function() {
title: 'linked to date and category axes',
xaxis: {
type: 'date',
range: ['2000-01-01', (new Date(2000, 1, 2)).getTime()]
range: ['2000-01-01', '2000-02-02']
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this old format for date axis range was mucking up the test code but not affecting the code being tested (because that's all after supplyDefaults cleans these) so it was useless.

},
yaxis: { type: 'category', range: ['a', 'b'] }
}
Expand Down