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

isSameISOWeek

import { isSameISOWeek } from "https://esm.sh/v135/date-fns@3.6.0/index.d.mts";
@example
// Are 1 September 2014 and 7 September 2014 in the same ISO week?
const result = isSameISOWeek(new Date(2014, 8, 1), new Date(2014, 8, 7))
//=> true
@example
// Are 1 September 2014 and 1 September 2015 in the same ISO week?
const result = isSameISOWeek(new Date(2014, 8, 1), new Date(2015, 8, 1))
//=> false
function isSameISOWeek<DateType extends Date>(dateLeft: DateType | number | string, dateRight: DateType | number | string): boolean;
§
isSameISOWeek<DateType extends Date>(dateLeft: DateType | number | string, dateRight: DateType | number | string): boolean
[src]

§Type Parameters

§
DateType extends Date
[src]

§Parameters

§
dateLeft: DateType | number | string
[src]
  • The first date to check
§
dateRight: DateType | number | string
[src]
  • The second date to check

§Return Type

§
boolean
[src]

The dates are in the same ISO week (and year)