Skip to content

iso8601 bug #90

@msterk

Description

@msterk

Hi,

someone copied your conversion from datetime.timedelta to iso8601 to Stack Overflow, and I spotted a bug in it. If you add these two tests they will fail:

iso = jsonify_timedelta(timedelta(seconds=10))
self.assertEqual(iso, 'PT10S') #will return PT1S
iso = jsonify_timedelta(timedelta(seconds=60))
self.assertEqual(iso, 'PT01M') #will return PT1MS

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