Module

x/date_fns/setWeek/index.js>default

date-fns Deno package
Very Popular
Latest
function default
import { default } from "https://dotland.deno.dev/x/date_fns@v2.22.1/setWeek/index.js";

Examples

// Set the 1st week to 2 January 2005 with default options: var result = setWeek(new Date(2005, 0, 2), 1) //=> Sun Dec 26 2004 00:00:00

// Set the 1st week to 2 January 2005, // if Monday is the first day of the week, // and the first week of the year always contains 4 January: var result = setWeek(new Date(2005, 0, 2), 1, { weekStartsOn: 1, firstWeekContainsDate: 4 }) //=> Sun Jan 4 2004 00:00:00

Parameters

dirtyDate
  • the date to be changed
dirtyWeek
  • the week of the new date
dirtyOptions