Skip to content

Cannot parse Tuesday or Thursday dates using "D, j M Y" format #24

Closed
@ikaronen-relex

Description

@ikaronen-relex

Steps to reproduce the issue

  1. Go to https://plugins.krajee.com/php-date-formatter/demo.
  2. Enter D, j M Y as the input format.
  3. Enter a date that falls on a Tuesday or Thurdays, such as Thu, 5 Dec 2019.

Expected behavior and actual behavior

  • Expected: parsing succeeds.
  • Observed: parsing fails with "Error: Cannot parse source date".

Further experimentation points to the trigger being the initial T in the input string. In particular, all of the following fail to parse:

  • Tue, 3 Dec 2019
  • Thu, 5 Dec 2019
  • Thu, 6 Dec 2019
  • Test, 6 Dec 2019
  • T, 6 Dec 2019

whereas all of the following are accepted:

  • Wed, 4 Dec 2019
  • Fri, 6 Dec 2019
  • Wed, 5 Dec 2019 (parsed as Thursday the 5th)
  • Whatever, 5 Dec 2019 (also parsed as Thursday the 5th)
  • X, 5 Dec 2019 (ditto)

Environment

Browsers

  • Google Chrome 78.0
  • Mozilla Firefox 71.0
  • Safari 13.0.3

Operating System

  • Mac OS X

Isolating the problem

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions