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

93
Vistas
Obtain Duration of a quarter in Luxon

I'm trying to obtain the Duration (or start and end dates) of an arbitrary 'quarter' in Luxon.

For example, suppose I want the beginning and ending dates of the 3rd quarter knowing only the quarter:

const quarterInQuestion = 3;

const startDateOfQuarter = DateTime.fromFormat(quarterInQuestion.toString(), 'q');

This will give me the start date of the quarter, but how can I obtain the end date as well. I've looked into Durations and Intervals but can't seem to get anything to work yet.

Many thanks!

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

I think you want the endOf method, to which you can pass the period that you want the end of from a date.

const startDateOfQuarter = DateTime.fromFormat('3', 'q');
const endDateOfQuarter = startDateOfQuarter.endOf('quarter')
about 4 years ago · Juan Pablo Isaza Denunciar
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