Date API returns wrong current date example in May

Created on 7 May 2014, over 10 years ago
Updated 23 January 2024, 10 months ago

Drupal shows wrong current date examples in May for Date fields, Date formats, etc.

<!--break-->

For example, at May 7, 2014 it shows '06/07/2014', or 'Jun 7 2014', etc. I think, that's because of following string in date_example_date() function:

  if (date_format($now, 'M') == date_format($now, 'F')) {
    date_modify($now, '+1 month');
  }

date_format($now, 'M') is equal to 'May', and date_format($now, 'F') is equal to 'May', too. So it adds 1 month to current date.

🐛 Bug report
Status

Active

Version

2.0

Component

Date API

Created by

🇧🇾Belarus Rdnala

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024