Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

240
Vistas
How can I get start and end of a week using dateFNS depeogn on the current date and custom start day?

I want to get the custom start and end day of week from current date. For example

If current date is 10/01/2022 and my start of the week start form Wednesday then I want to get a week range between 29/12/2021 to 04/01/2022. Till now I have Monday as start of the week and Sunday as the end of the week. For that I am using below code to get the week range. How Can I get the custom week range?

const date = new Date();
const start = dateFNS.sub(dateFNS.startOfWeek(date, { weekStartsOn: 1 }), { days: 7 });
const end = dateFNS.sub(dateFNS.endOfWeek(date, { weekStartsOn: 1 }), { days: 7 });
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda