For Magento 1.x
How do I sort product based on a date attribute by a month and year only, rather than on the whole date? The code looks a bit like this:
Mage::getSingleton('...')->getProductCollection() ->addAttributeToSort('published_date', 'DESC') // -> want to sort on Month and Year ->addAttributeToSort('price', 'DESC');
The overall requirement is to sort products based on Year, then Month, then Price... hence this question.
Thanks in advance!