In Moment.js, how do you get the current financial Quarter?

后端 未结 9 1728
深忆病人
深忆病人 2020-12-14 16:07

Is there a simple/built in way of figuring out the current financial quarter?

ex:

  • Jan-Mar: 1st
  • Apr-Jul: 2nd
  • Jul-Sept: 3rd
9条回答
  •  悲哀的现实
    2020-12-14 16:52

    I dont think any of these answers explain how to get the financial quarter. They explain how to get the calendar quarter.

    I do not have a clean answer as thats what led me here. But the fiscal quarter is what is really wanted. And that is based on the start month of the fiscal year.

    For example if my company's fiscal start month is February. Then at the time of writing this January 9th 2017 I'm actually in Q4 2016.

    To accomplish this we need a way to get the quarter relative to a supplied integer of the start month.

提交回复
热议问题