when trying to implement a custom date formatter to a field, I get the following errors:

Notice: Undefined index: custom_date_format in date_formatter_format() (line 447 of /var/www/drupalvm/drupal/web/sites/all/modules/date/date.module).
Notice: Undefined index: formatted_timezone in theme_date_display_combination() (line 139 of /var/www/drupalvm/drupal/web/sites/all/modules/date/date.theme).
Notice: Undefined index: formatted_time in theme_date_display_combination() (line 145 of /var/www/drupalvm/drupal/web/sites/all/modules/date/date.theme).
Notice: Undefined index: formatted_time in theme_date_display_combination() (line 147 of /var/www/drupalvm/drupal/web/sites/all/modules/date/date.theme).

It looks as if this is because the custom formatter field is not saving properly, as when I go to re-edit the feild is blank. Also it shows the message.

Display dates using the default format because the specified format (custom) is not defined
Members fund testing for the Drupal project. Drupal Association Learn more

Comments

roborat created an issue. See original summary.

DeveloperChris’s picture

I can confirm this issue in version 7.54

When saving a custom format for a date display the format is not saved and the date object defaults to the default display format.

DeveloperChris’s picture

FileSize
11.23 KB
9.4 KB
11.98 KB

I have found a workaround to this issue

First create a new date format for example d-M-Y
Add Format

Create a new date type based on your format
Add Type

Use the new date type as the formatter in the content types display options dialogue
Use Date Type

Doesn't solve the original issue but works around it