'Remove all elements older than 30 days from the history'

def trim(self):

    date = (datetime.today() - timedelta(days=30)).strftime(History.date_format)
    for dbData in [x[u'doc'] for x in sickrage.srCore.mainDB.db.all(u'history', with_doc=True) if (x[u'doc'][u'date'] < date)]:
        sickrage.srCore.mainDB.db.delete(dbData)
