Skip to content

'H' format string broken in strict parsing #1401

Closed
strukturag/spreed-webrtc
#58
@tp

Description

I hit an unexpected error when using 'H' to parse 24h-time values without a leading zero:

> var moment = require('moment');
undefined
> moment.version
'2.5.0'
> moment().format('H')
'17'
> var parsed = moment('17', 'H');
undefined
> parsed.isValid()
true
> var parsed = moment('17', 'H', true);
undefined
> parsed.isValid()
false

I would expect H to be usable here, so that the code can also work with times before noon.

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions