import { differenceInCalendarWeeks } from "https://deno.land/x/date_fns@v2.12.0/index.js";
Examples
// How many calendar weeks are between 5 July 2014 and 20 July 2014?
var result = differenceInCalendarWeeks(
new Date(2014, 6, 20),
new Date(2014, 6, 5)
)
//=> 3
// How many calendar weeks are between 5 July 2014 and 20 July 2014? var result = differenceInCalendarWeeks( new Date(2014, 6, 20), new Date(2014, 6, 5) ) //=> 3
// If the week starts on Monday,
// how many calendar weeks are between 5 July 2014 and 20 July 2014?
var result = differenceInCalendarWeeks(
new Date(2014, 6, 20),
new Date(2014, 6, 5),
{ weekStartsOn: 1 }
)
//=> 2
// If the week starts on Monday, // how many calendar weeks are between 5 July 2014 and 20 July 2014? var result = differenceInCalendarWeeks( new Date(2014, 6, 20), new Date(2014, 6, 5), { weekStartsOn: 1 } ) //=> 2