@mantine/dates
Version:
Calendars, date and time pickers based on Mantine components
1 lines • 633 B
Source Map (JSON)
{"version":3,"file":"get-week-number.mjs","names":[],"sources":["../../../../src/components/Month/get-week-number/get-week-number.ts"],"sourcesContent":["import dayjs from 'dayjs';\nimport isoWeek from 'dayjs/plugin/isoWeek.js';\nimport { DateStringValue } from '../../../types';\n\ndayjs.extend(isoWeek);\n\nexport function getWeekNumber(week: DateStringValue[]): number {\n const monday = week.find((date) => dayjs(date).day() === 1);\n return dayjs(monday).isoWeek();\n}\n"],"mappings":";;;;AAIA,MAAM,OAAO,OAAO;AAEpB,SAAgB,cAAc,MAAiC;CAE7D,OAAO,MADQ,KAAK,MAAM,SAAS,MAAM,IAAI,CAAC,CAAC,IAAI,MAAM,CACvC,CAAC,CAAC,CAAC,QAAQ;AAC/B"}