Fix issue 6751: epoch date formats '%H:%M:%S' as 'undefined'#6752
Fix issue 6751: epoch date formats '%H:%M:%S' as 'undefined'#6752archmoj merged 2 commits intoplotly:masterfrom
Conversation
This patch fixes issue plotly#6751, where the epoch timestamp '1970-01-01 00:00:00', with 'hoverformat' '%H:%M:%S' is formatted as 'undefined'. Signed-off-by: adamjhawley <adamhawley99@gmail.com>
Signed-off-by: adamjhawley <adamhawley99@gmail.com>
|
Let's add two tests for each fix to this file below this test: plotly.js/test/jasmine/tests/hover_label_test.js Lines 4368 to 4382 in 6408944 You could then |
|
@archmoj I am currently trying to add the tests but I am having difficulty with I see that the test you included has 'xpx: 65'. I am wondering how I can correctly populate the same parameter for my tests. |
If you add console log in var dates = [0,1].map(x => `1970-01-01 00:00:0${x}`);
var data = [
{
type: 'scatter',
x: dates,
y: [5,2,3,1,4],
hovertemplate: "%{x}, %{y}"
}]
var layout = {
xaxis: {
tickformat: '%H:%M:%S',
hoverformat: '%H:%M:%S'
},
}
Plotly.newPlot(gd, data, layout);Then you could hover over the desired position to read the print in the console. |
|
Alternatively you could add a unit test instead here: |
|
@adamjhawley |
|
💃 |
|
@archmoj ok, thanks a lot, will do! Thanks for all of your help! |
Hi all! This is my first time contributing to plotly so open for feedback & comments :)
This patch fixes issue #6751, where the epoch timestamp '1970-01-01 00:00:00', with 'hoverformat' '%H:%M:%S' is formatted as 'undefined'.