David Kimura PRO said over 6 years ago on Charts and Graphs :

The methods are within the GroupDate gem https://github.com/ankane/groupdate

The gem's documentation does say that it is compatible with postgres, but I am not sure if there is any additional setup on postgres like there is with MySQL.