I have the following problem;
i want a certain date format to show up in my view. I.e.; now it is 'saturday, february 12, 2011', but i'd like it to be (for example) 'saturday, 12 february, 2011'. I tried to do it in different ways, but they do not work out. I'll explain the things i've tried:

1. I've tried to switch the date format in the settings. For example I tried to change the 'long' date format type. The standard in Long is set to saturday, february 12, 2011 - 23.14. I want it to be: saturday, 12 february, 2011 - 23.14. This is one of the options in the list, so I select the option I want in the date type 'long'. Then I click 'Save settings'. It looks like it saves OK, but it doesn't, it sais 'saturday, february 12, 2011' again as date type 'long'. So that doesn't work.

2. I've created a custom date format, saying: saturday 12 february 2011. So I tried the things listed at 1. again, selected my date format from the list, saved settings, but nothing has changed.

3. I've created a custum date type; called 'Date', as i would like it to be. After that in my view i have to select two things: Formatter and Format (?). I've tried different settings; Formatter & Format set as 'Date', just Formatter set as 'Date' or just Format set as 'Date' (instead of long, short, etc). All the things do not work out, because when I save my view there is an error in my view:
Warning: strtr() expects parameter 1 to be string, array given in date_limit_format() (regel 1585 van C:\xampp\htdocs\Valencia\sites\all\modules\date\date_api\date_api.module).
Notice: Undefined index: formatted_timezone in theme_date_display_combination() (regel 118 van C:\xampp\htdocs\Valencia\sites\all\modules\date\date.theme).
Warning: strtr() expects parameter 1 to be string, array given in date_limit_format() (regel 1585 van C:\xampp\htdocs\Valencia\sites\all\modules\date\date_api\date_api.module).
Notice: Undefined index: formatted_timezone in theme_date_display_combination() (regel 118 van C:\xampp\htdocs\Valencia\sites\all\modules\date\date.theme).

What can I do to fix this? I just want to change the appearance of my date in my view....

Comments

knalstaaf’s picture

Having the same issue: Custom date format not working.

Subscribing.

knalstaaf’s picture

Marlies, are you using Custom Formatters, or did you use that module at some point?

I've used it in the project I'm having the same difficulties with, but I removed that module according to the standard procedure (disbaled, de-installed, module folder removed from server). I have no clue whether this could be related, that's why I'm asking.

knalstaaf’s picture

arlinsandbulte’s picture

Status: Active » Closed (won't fix)

Date 7.x-1.x is unsupported.
This issue should be verified in the latest version of Date (7.x-2.x-dev) and re-opened if still valid.

Thanks

designcontext’s picture

StatusFileSize
new72 KB

I use the 7.2dev version and still have problems. I set up a date format with only the day. Nothing appears when I use this format.

jumoke’s picture

Version: 7.x-1.x-dev » 7.x-2.x-dev
Status: Closed (won't fix) » Active

I am having this same issue as well 7.x-2.x-dev

rafinskipg’s picture

Having it on 7.x.2-1

Notice: Undefined index: formatted_timezone en theme_date_display_combination() (línea 134 de D:\programs\wamp\www\patrimonio\sites\all\modules\contrib\date\date.theme).

rafinskipg’s picture

Component: Miscellaneous » Code
Category: support » bug
karens’s picture

Status: Active » Closed (cannot reproduce)

Per the image in #6, Date provides no formatter called 'standard'. It provides three formatters "Date and Time", "Time Ago", and "Plain". I have no idea where "Standard" came from. Whatever created the formatter is the problem here.

#8 provides no information about how to replicate the problem, so I have no idea what that is. I can't see any error like that.

dppeak’s picture

I get the error from #8 as well. If you define a date with granularity of Year, Month and Day only (don't check hour, minute or second) you will get this error. You have to at least check "Hour" in order to not receive this error.

dppeak’s picture

Status: Closed (cannot reproduce) » Active
skadu’s picture

Sorry to revive an old issue, but I can confirm this issue exists exactly as described by dppeak. I have a date field being pulled into a calendar view. The date field does not collect information at the hour, minute or second granularity. So when the theme function run (line 139 of date.theme)

  // Pull the timezone, if any, out of the formatted result and tack it back on
  // at the end, if it is in the current formatted date.
  $timezone = $dates['value']['formatted_timezone'];
  if ($timezone) {
    $timezone = ' ' . $timezone;
  }

It attempts to pull a timezone out of formatted_timezone which has never been set. The attached patch:

  • initializes the $timezone variable as an empty string (which is what appears to be there in other cases
  • performs an isset check for formatted_timezone field and processes the timezone if the field exists

The patch is based on "7.x-2.9", I'm not using the Dev version, as it rewrites the Views filters and is marked as not ready for use. However, the relevant chunk of code is the same between both versions.

Please let me know if anything looks out of place in the patch.

~ Cooper

gwolfman’s picture

I also encountered this notice, as well as another undefined index notice for 'formatted_time'

In the attached patch I fixed both notices with methods similar to those of skadu. Seems to work and not interfere with the other date formatting around my sites.

socialnicheguru’s picture

Status: Active » Needs review
aporie’s picture

I was trying to display date with H:i format.

Patch #14 fixed the issue for me.

Thanks

spokje’s picture

Status: Needs review » Reviewed & tested by the community

Patch #14 applies cleanly to latest Dev branch. Works fine: => RTBC

The last submitted patch, 13: date-undefined-index-timezone-10599027.x-2.9.patch, failed testing. View results

damienmckenna’s picture

Component: Code » User interface
Status: Reviewed & tested by the community » Needs work
Issue tags: -date, -date format, -drupal 7, -views3 +Needs tests

Thank you for taking the time to put together the patch, and I'm glad to see it still passes the existing test coverage. However, I think some additional test coverage would be useful to make sure it works as intended.

lazzyvn’s picture

StatusFileSize
new721 bytes
new673 bytes

I got the same issue
here is my patch it 's more simple