Skip to content

Starter code has error in fortmat_datetime function #39

@MichaelJBigelow

Description

@MichaelJBigelow

If the locale is not specified when calling babel.dates.format_datetime(), it throws the following error:
AttributeError: 'NoneType' object has no attribute 'days'

The fix on my Windows 10 machine is the following:
return babel.dates.format_datetime(date, format, locale='en')

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions