Ashish Patel: TIL

Atom feed

Recently added: Dotnet Common commands, NestJS Common commands, Flask Common commands, Django Common commands, PostgreSQL Common commands

Get the start and end of current week

const dayjs = require('dayjs')
const isoWeek = require('dayjs/plugin/isoWeek')
dayjs.extend(isoWeek)

const currentWeek = `${dayjs()
  .startOf('isoWeek')
  .tz('Asia/Kolkata')
  .format('DD-MMMM')} - ${dayjs().endOf('isoWeek').tz('Asia/Kolkata').format('DD-MMMM')}`

Created 2020-08-25T07:31:06+05:30 · Edit