What do you mean by “make d3 compatible with moment”? You can use both libraries together if you prefer moment’s API to
d3-time and
d3-time-format; in that sense they are already compatible. For example, you can pass a custom function to
axis.tickFormat to override how ticks are formatted. D3 APIs that work with dates expect JavaScript Date objects (or values that coerce to milliseconds since UNIX epoch), so for example you can pass a moment instance to a time scale’s domain and it will be correctly coerced to a standard JavaScript Date.