Dygraph.dateString_: shows milliseconds if any. #774

Merged
merged 10 commits into from Sep 15, 2016

Projects

None yet

3 participants

@pierriko
Contributor

1st commit add a feature to Dygraph.dateString_: shows milliseconds if any.
2nd commit fixes a typo in dateAxisLabelFormatter.

pierriko added some commits Sep 12, 2016
@pierriko pierriko [utils] dateString_ display Milliseconds if any 0333381
@pierriko pierriko [utils] fix dateAxisLabelFormatter milliseconds c9e880e
@pierriko pierriko [util] dateString_: compute ms in frac
1e7f980
@coveralls

Coverage Status

Coverage increased (+0.007%) to 89.57% when pulling 1e7f980 on pierriko:master into 051a854 on danvk:master.

@coveralls

Coverage Status

Coverage decreased (-0.01%) to 89.548% when pulling 1e7f980 on pierriko:master into 051a854 on danvk:master.

@pierriko pierriko [utils] clean hmsString_ format
1789c80
@coveralls

Coverage Status

Coverage decreased (-0.01%) to 89.548% when pulling 1789c80 on pierriko:master into 051a854 on danvk:master.

@pierriko pierriko [utils] add milliseconds padding in hmsString_
4ccdd90
@coveralls

Coverage Status

Coverage decreased (-0.03%) to 89.529% when pulling 4ccdd90 on pierriko:master into 051a854 on danvk:master.

@danvk
Owner
danvk commented Sep 14, 2016

Thanks for this! If you could add a unit test that shows the new behavior, I'd be happy to merge.

@pierriko pierriko [develop] add note on npm install
53d5aa9
@coveralls

Coverage Status

Coverage decreased (-0.03%) to 89.529% when pulling 53d5aa9 on pierriko:master into 051a854 on danvk:master.

@pierriko pierriko [tests] add labelsDateMilliseconds test
19591cd
@pierriko
Contributor

Great ! Let me know if the test is OK for you.

@coveralls

Coverage Status

Coverage decreased (-0.01%) to 89.551% when pulling 19591cd on pierriko:master into 051a854 on danvk:master.

@danvk

Sorry, I should have been clearer what I meant by "test". This would be a good thing to unit test, perhaps here https://github.com/danvk/dygraphs/blob/8cc4108bdb0db5006d794be50d1bbca9558373e9/auto_tests/tests/date_formats.js

tests/labelsDateMilliseconds.html
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>UTC date labels</title>
@danvk
danvk Sep 14, 2016 Owner

Update title.

tests/labelsDateMilliseconds.html
+ <p>This shows how milliseconds are displayed when present.</p>
+
+ <div id="div_loc" style="width:600px; height:200px;"></div>
+ <div id="div_utc" style="width:600px; height:200px;"></div>
@danvk
danvk Sep 14, 2016 Owner

update these names

tests/labelsDateMilliseconds.html
+ labels: ['time with ms', 'random']
+ }
+ );
+ gutc = new Dygraph(
@danvk
danvk Sep 14, 2016 Owner

also these

@@ -6,6 +6,10 @@ This is a step-by-step guide explaining how to do it.
### How-to
+To install dependencies, run
@danvk
danvk Sep 14, 2016 Owner

thanks :)

pierriko added some commits Sep 15, 2016
@pierriko pierriko [utils] add millis in dateAxisLabelFormatter c391619
@pierriko pierriko [tests] fix requested changes in labelsDateMillis 097f8ab
@pierriko pierriko [auto_tests] add date_formats testMillisecondsDate
2dd6580
@coveralls

Coverage Status

Coverage increased (+0.03%) to 89.593% when pulling 2dd6580 on pierriko:master into 051a854 on danvk:master.

@coveralls

Coverage Status

Coverage increased (+0.03%) to 89.593% when pulling 2dd6580 on pierriko:master into 8cc4108 on danvk:master.

@danvk
danvk approved these changes Sep 15, 2016 View changes
@danvk danvk merged commit 2d0fdf6 into danvk:master Sep 15, 2016

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage increased (+0.03%) to 89.593%
Details
@danvk
Owner
danvk commented Sep 15, 2016

Great, thanks for the fix & tests!

@pierriko pierriko added a commit to pierriko/dygraphs that referenced this pull request Sep 22, 2016
@pierriko pierriko Dygraph.dateString_: shows milliseconds if any. (#774)
* [utils] dateString_ display Milliseconds if any

* [utils] fix dateAxisLabelFormatter milliseconds

* [util] dateString_: compute ms in frac

* [utils] clean hmsString_ format

* [utils] add milliseconds padding in hmsString_

* [develop] add note on npm install

* [tests] add labelsDateMilliseconds test

* [utils] add millis in dateAxisLabelFormatter

* [tests] fix requested changes in labelsDateMillis

* [auto_tests] add date_formats testMillisecondsDate
4bb589d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment