Skip to content
This repository has been archived by the owner on Feb 19, 2022. It is now read-only.

Fix date handling cross axis #318

Merged
merged 9 commits into from
Jul 27, 2016
Merged

Fix date handling cross axis #318

merged 9 commits into from
Jul 27, 2016

Conversation

ebrillhart
Copy link
Contributor

update some domain methods in order to fix FormidableLabs/victory#139

supported by FormidableLabs/victory-core#90

@boygirl

const zeroDomain = isDependent ? [Math.min(...domain, 0), Math.max(... domain, 0)]
: domain;
const min = Collection.containsDates(domain) ?
Helpers.retainDate(Math.min(...domain, 0)) :
Copy link
Contributor

Choose a reason for hiding this comment

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

if all retainDate does is new Date(val) why not just do that here? When we were chatting about extracting helper methods I was imagining getMaxValue(arr) which would do all this date checking and return the correct value type. If you end up going that route, the new methods should be added to util/collection since they operate on arrays. I thought this would be happening in may more places though, so if you just want to swap out retainDate(val) for new Date(val) that's fine too

@ebrillhart
Copy link
Contributor Author

@boygirl got it, that makes sense. when I was actually implementing it I wondered about that. I'll modify the method but keep it external so that we can more easily add it to other/future methods if need be.

@ebrillhart
Copy link
Contributor Author

ebrillhart commented Jul 26, 2016

@boygirl updated - also, tests run fine in the terminal

@ebrillhart
Copy link
Contributor Author

@boygirl yayyy tests pass

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

Successfully merging this pull request may close these issues.

Axis renders 1970 date as cross axis point due to Unix epoch
3 participants