Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

isThisWeek

import { isThisWeek } from "https://esm.sh/v135/date-fns@3.6.0/index.d.mts";
@example
// If today is 25 September 2014, is 21 September 2014 in this week?
const result = isThisWeek(new Date(2014, 8, 21))
//=> true
@example
// If today is 25 September 2014 and week starts with Monday
// is 21 September 2014 in this week?
const result = isThisWeek(new Date(2014, 8, 21), { weekStartsOn: 1 })
//=> false
function isThisWeek<DateType extends Date>(date: DateType | number | string, options?: IsThisWeekOptions): boolean;
§
isThisWeek<DateType extends Date>(date: DateType | number | string, options?: IsThisWeekOptions): boolean
[src]

§Type Parameters

§
DateType extends Date
[src]

§Parameters

§
date: DateType | number | string
[src]
  • The date to check
§
options?: IsThisWeekOptions optional
[src]
  • The object with options

§Return Type

§
boolean
[src]

The date is in this week