I'm trying to accomplish something in javascript but I don't know if it's possible.
This is what I would like to do:
I'm trying to build a media calendar that when the user selects a day from the jQuery Datepicker calendar it would auto populate another text box with the quarter number of the year.
Like Q1, Q2, Q3 and Q4.
The problem is that for the media calendar starts the first calendar Monday of the year so for example 12/31/2019 was a Monday so it would be part of Q1 2020 and same with the last day of the year, this year Q4 ends in 12/27/2020 and Q1 2021 starts on 12/28/2020 etc.
What function could I create to give me Q1 as the first monday of the calendar year and Q4 as the last sunday of the calendar year?