8000 Parsing date from format `hh` gives valid true even if the hour is greater than 12 · Issue #1655 · moment/luxon · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Parsing date from format hh gives valid true even if the hour is greater than 12 #1655
Open
@rohitkhatri

Description

@rohitkhatri

Describe the bug
Parsing time from string based on a hh:mm a format gives valid true even if the hour is greater than 12

To Reproduce

import { DateTime } from "luxon";

const date = DateTime.fromFormat('13:00 AM', 'hh:mm a', {});
console.log(date);
console.log(date.isValid);

Actual vs Expected behavior
It should give invalid since the definition of hh is 12 hours clock

Desktop (please complete the following information):

  • OS: MacOS M1
  • Browser Chrome: 123
  • Luxon version: 3.1.0
  • Your timezone: Asia/Kolkata

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

      0