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....
| Comment | File | Size | Author |
|---|---|---|---|
| #20 | fix_custom_date_views.patch | 673 bytes | lazzyvn |
| #20 | fix_custom_date_views.patch | 721 bytes | lazzyvn |
| #14 | date-multiple-undefined-indexes-1059902-7.x-2.8.patch | 1 KB | gwolfman |
| #13 | date-undefined-index-timezone-10599027.x-2.9.patch | 895 bytes | skadu |
| #6 | drupal-date.jpg | 72 KB | designcontext |
Comments
Comment #2
knalstaaf commentedHaving the same issue: Custom date format not working.
Subscribing.
Comment #3
knalstaaf commentedMarlies, 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.
Comment #4
knalstaaf commentedComment #5
arlinsandbulte commentedDate 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
Comment #6
designcontext commentedI 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.
Comment #7
jumoke commentedI am having this same issue as well 7.x-2.x-dev
Comment #8
rafinskipg commentedHaving it on 7.x.2-1
Comment #9
rafinskipg commentedComment #10
karens commentedPer 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.
Comment #11
dppeak commentedI 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.
Comment #12
dppeak commentedComment #13
skaduSorry 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)
It attempts to pull a timezone out of formatted_timezone which has never been set. The attached patch:
$timezonevariable as an empty string (which is what appears to be there in other casesThe 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
Comment #14
gwolfman commentedI 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.
Comment #15
socialnicheguru commentedComment #16
aporieI was trying to display date with H:i format.
Patch #14 fixed the issue for me.
Thanks
Comment #17
spokjePatch #14 applies cleanly to latest Dev branch. Works fine: => RTBC
Comment #19
damienmckennaThank 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.
Comment #20
lazzyvn commentedI got the same issue
here is my patch it 's more simple