score:1

Accepted answer

The %V format option was not added until d3 v4.12 (change log)

Otherwise your code should be fine:

var width = 500;
var height =400;

var svg = d3.select("svg")
  .attr("width",width)
  .attr("height",height);
  
var g = svg.append("g");

var parse = d3.timeParse("%B %d, %Y");
var domain = [parse("January 1, 2017"), parse("January 1, 2018")]


var x = d3.scaleTime()
    .domain(domain)
    .range([10, width-10]);


g.append("g")
    .attr("transform", "translate(10,150)")
    .attr("class", "axis")
    .call(d3.axisBottom(x)
        .ticks(20)
        .tickFormat(d3.timeFormat("Week %V"))
     )
    
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/4.12.0/d3.min.js"></script>

<svg></svg>


Related Query

More Query from same tag