Rails have quite a few methods for use with the date and time just as
Similarly, rails also provide some methods like
end_of_quarter for getting dates of when the quarter for the calendar year and month is.
Rails do not provide methods for getting the monthly number for the quarter. For that, we would use something like -
In the upcoming version of Rails 7.1, it’ll provide a method for getting quarter of the date it is used upon -
Look at PR for more information.