Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/date_fns/index.js>getWeekYear

date-fns Deno package
Very Popular
Go to Latest
function getWeekYear
import { getWeekYear } from "https://deno.land/x/date_fns@v2.0.0-alpha.35/index.js";

Examples

// Which week numbering year is 26 December 2004 with the default settings? var result = getWeekYear(new Date(2004, 11, 26)) //=> 2005

// Which week numbering year is 26 December 2004 if week starts on Saturday? var result = getWeekYear(new Date(2004, 11, 26), { weekStartsOn: 6 }) //=> 2004

// Which week numbering year is 26 December 2004 if the first week contains 4 January? var result = getWeekYear(new Date(2004, 11, 26), { firstWeekContainsDate: 4 }) //=> 2004

Parameters

dirtyDate
  • the given date
dirtyOptions