'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!



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source