def resolve_date(self, d, context):
        try:
            d = template.resolve_variable(d, context)
        except template.VariableDoesNotExist:
            return None
        
        # Handle date objects
        if isinstance(d, (datetime.date, datetime.datetime)):
            return d
        
        # Assume literals or strings
        if d == "now":
            return datetime.datetime.now()
        if d == "today":
            return datetime.date.today()
        try:
            return dateutil.parser.parse(d)
        except ValueError:
            return None
Resolve start/end, handling literals
dataset/ETHPy150Open jacobian-archive/jellyroll/src/jellyroll/templatetags/jellyroll.py/GetJellyrollItemsNode.resolve_date