fix for date ranges when getting all messages