from typing import Optional
from datetime import datetime


def json_default(item: object) -> Optional[object]:
    """JSON object type converter that handles datetime objects.

    Arguments:
        item: The object JSON is trying to serialise.
    """
    if isinstance(item, datetime):
        return item.isoformat()
    return None