I'm using last dev od date module.

Stept to reproduce:

* Create a custom format as "F Y".
* Create a date field in any content type allowing to enter only month and year and a custom input as "F Y"
* Create a content and you get that error:

Notice: Array to string conversion en date_limit_format() (línea 1582 de /home/myhost/sites/all/modules/date/date_api/date_api.module).

Comments

RicardoJBarrios’s picture

If you set the display also to the "F Y" format you get a value like (it's set to July 2006):

Fri, 30 Jun 2006 +0200Fri, 30 Jun 2006 +020006 Fri, 30 Jun 2006 +0200Fri, 30 Jun 2006 +0200

brightbold’s picture

I got this error with the custom format g:ma, which then resulted in the date displaying on the calendar month view like this:
PMThu, 03 Feb 2011 18:00 -0500Thu, 03 Feb 2011 18:00 -0500pm11 - PMThu, 03 Feb 2011 22:00 -0500Thu, 03 Feb 2011 22:00 -0500pm11 Thu, 03 Feb 2011 18:00 -0500Thu, 03 Feb 2011 18:00 -0500

Alexander Matveev’s picture

subscribe

joostvdl’s picture

Same error here. I created a format: j F Y - G:i

But it looks that it doesn't support a custom type. If I select one of the default (Long, Middle, Short) types there is no problem. If I select the Custom Type, it goes wrong.

zilverdistel’s picture

I have the same issue with a custom format "d.m".

At first I had a "500 Internal Server Error" on whichever page that tried to display a date field in this custom format (node page, a view).

After I enabled the "date_views" module, those pages started loading, but then I got the error described here:

Notice: Array to string conversion in date_limit_format() (regel 1592 van /drupal/sites/all/modules/date/date_api/date_api.module).

Dates are now displayed as

PMSun, 13 Mar 2011 17:00 +0100Sun, 13 Mar 2011 17:00 +0100pm11 Sun, 13 Mar 2011 17:00 +0100Sun, 13 Mar 2011 17:00 +0100

I find it strange that the date_views module influences the rendering of a simple node page.

I'm running date-7.x-2.0-alpha1 and views-7.x-3.x-dev.

zilverdistel’s picture

I set up a local copy of the website I'm working on, I get slightly different messages now:

Warning: strtr() expects parameter 1 to be string, array given in date_limit_format() (regel 1592 van /drupal/sites/all/modules/date/date_api/date_api.module).
Notice: Undefined index: formatted_timezone in theme_date_display_combination() (regel 117 van /drupal/sites/all/modules/date/date.theme).
Warning: strtr() expects parameter 1 to be string, array given in date_limit_format() (regel 1592 van /drupal/sites/all/modules/date/date_api/date_api.module).
Notice: Undefined index: formatted_timezone in theme_date_display_combination() (regel 117 van /drupal/sites/all/modules/date/date.theme).

zilverdistel’s picture

This has definitely something to do with localisation. The following solved my problem:

On "admin/config/regional/date-time/locale": click "edit" for all languages and just save the settings.

Shouldn't this be handled automatically when a new custom format has been created?

zilverdistel’s picture

Title: Array to string conversion in date_limit_format() error » Creating a custom date format should create corresponding localized formats
Project: Date » Drupal core
Version: 7.x-1.x-dev » 7.x-dev
Component: Date API » locale.module

I think this is not an issue with the Date module, so I'm handing this over to the Drupal core issue queue.

Also: changing the title since this seems to be the deeper cause of this issue.

metalrom’s picture

subscribing

brightbold’s picture

Clearly my date format above was idiotic, and should have been g:ia, but I had exactly the same symptoms as zilverdistel in #5 either way. Happily, zilverdistel's solution in #8 solved the problem for me. Thanks a lot for this solution - the error had locked me out of the view with the 500 Internal Server Error so I was unable to roll back my changes.

xtiansimon’s picture

subscribe

thomaslausz’s picture

brightbold’s picture

Hey @thomasvum — did you know you don't need to +1 subscribe any more? Just scroll to the top of the issue and click the "Follow" button. Learn more in Stop Subscribing, Start Following.

thomaslausz’s picture

sorry about that....
how do I delete my subscribe?

Status: Active » Closed (outdated)

Automatically closed because Drupal 7 security and bugfix support has ended as of 5 January 2025. If the issue verifiably applies to later versions, please reopen with details and update the version.