In Page > Fields > Configure field > Formats, "Custom date format" does not appear in the dropdown list.
List content is:
Default
Long
Medium
Short
ISO
Timestamp
Feed
iCal
As Time Ago
This is not a duplicate of #243408: Custom date field formats not processed.
Thanks,
Vianney Stroebel
Co-org.net - Développement Drupal - Paris.
| Comment | File | Size | Author |
|---|---|---|---|
| #31 | cache_to_clear.jpg | 113.73 KB | arlinsandbulte |
Comments
Comment #1
merlinofchaos commentedOf course, since you don't say what field you're talking about, I can only tell that you're talking about date.module because it uses ISO and iCal, things which are not part of views.module itself but are provided by date.
Comment #2
Viybel commentedSorry for that. I thought this was handled by Views but I realize it probably is a bug from the Date module (which I do use).
I'm a great admirer of your work and I'll try to file decent bug reports in the future...
Thanks,
Vianney Stroebel
Co-org.net - Développement Drupal - Paris.
Comment #3
karens commentedThere is no 'custom date format', so that's why it doesn't show up in the list. See my response to the other issue you filed.
Comment #4
jeff h commentedSorry, I have the same question, and I can't find any other relevant post by Viybel :(
The best I can gather is that there's been a deliberate decision to move the custom date format to a separate config setting for each date field. Unfortunately that makes me want to poke myself in the eye for the following reason;
Let's say I'm building a view which displays a bunch of nodes on my site, which contain a special CCK date field called "finished on". I want the "finished on" field to be displayed in my results table as such "31 March 2009". Easy, set up a short date format to look like this, because I will want this all over the site in other places too.
However, let's say I then want to group my view results by the month each node was "finished on". I need a field in my views results which contains nothing but the date's month. I certainly won't find this useful anywhere else in my site, nor even anywhere else my CCK type is being displayed.
It seems I can no longer do this by creating a one-off custom format at a view field level, which is not only a bit frustrating as mentioned above, but inconsistent with the general behaviour of other dates in views eg node created, node modified.
Am I missing something?
Thanks for an otherwise fantastic module :)
Jeff
Comment #5
andrewsuth commentedHi KarenS,
Firstly, the more I use the Date module the more I realise how well it's been developed and just how flexible it is. When I stumbled across the option to create
custom date and time formatsI was very impressed. Great work, keep it up!I had the same problem as outlined in this issue, where my custom date and time format would not appear as a format option in Views. In fact, I was about to open my own issue when I found this one - so I went to verify my View again and magically the custom date and time field I created was now available as a format type.
All I had done before was go to the Content-Type with the CCK Date and re-save the Date field. Perhaps this was just a coincidence, but now it appears as an option in Views. I am using the latest
Date 6.x-2.1module withViews 6.x-2.4@jeff h: Try this out and see if it works for you too.
The format for
CCK Datein Views now appears like this:Format: *
Where
Calendar Dayis the custom Date format I created.This feature is brilliant as it doesn't limit you to the standard formats for Views (imagine if you need more formats than just
Short,MediumandLong). For me, this means a lot less fiddly Views field theming - it's a real time saver.Once again, great work KarenS!
Comment #6
karens commentedThis should be working right.
Comment #7
SeanBannister commentedAndrewsuth: Your spot on, I had the same problem with the custom date format not displaying. All I did is edited the content type that the date field was assigned to and hit save. Now it displays in my Views.
Not exactly sure what the save button is doing to expose the field to views but it would be handy if it happened when you save the custom format.
Comment #8
andrewsuth commentedSo there's a few of us who have experienced this minor issue.
Perhaps this would be worth looking into KarenS?
Comment #9
roald commentedHad the same minor issue - fixed by re-saving the content type.
Thanks for awesome work :)
Comment #10
fred0 commentedI can confirm the behavior/fix from #5.
Additionally, if you go in to the date field in the content type and change the default format, that change will override the choice in Views. I had to then go into Views, open the field settings and hit update to get it to use the choice in Views again.
Comment #11
andrewsuth commentedAll that is required is to flush the caches and your new custom Date will magically appear in Views.
Comment #13
JayKayAu commentedFor the benefit of people who are new to Drupal, the way you can clear your cache in Drupal 6 is by going to: Admin > Site Configuration > Performance, where you'll find a button that does this.
I had exactly the same problem as described above, and I'm wondering (coming from a basis of zero knowledge of Drupal's caching mechanism) if it's possible/reasonable to flush (parts of) the cache automatically when you create a new Custom Date Format?
Comment #14
andrewsuth commented@JayKayAu: That makes a lot of sense to me.
@KarenS: What do you think about getting this into the latest DEV?
Comment #15
kmontyI can confirm that clearing the cache solved the issue.
Maybe we can change the module to clear the cache when saving a format?
Comment #16
kmontyComment #17
kmontyComment #18
arlinsandbulte commentedNote: Marked #578964: Disable caching for field editing as duplicate of this issue.
Comment #19
Anonymous (not verified) commentedI can confirm this bug, as I stated in #578964: Disable caching for field editing
Comment #20
koyama commented+1 subscribe
Comment #21
harcher commentedHappened to me too.
Flushed the cache and worked.
However, this is not ideal and should be fixed.
Drupal 6.14
Views 6.x-2.6
Date 6.x-2.4
Comment #22
karenm commentedI had this same issue, however both running cron and clearing the views cache did not allow the custom format to appear in content types (when configuring a field under cck's manage fields), nor appear in the format list in views.
It was not until I re-saved an unchanged configuration of the field in question within a content type already containing the field that it updated things.
Drupal 6.15
Views 6.x-2.8
Date 6.x-2.4
Comment #23
endiku commentedConcur, the cache needs to be flushed for a newly created custom date format to appear in the format list for a date field in views. Not the end of the world but there it is.
Comment #24
gilcreque commentedI'm experiencing this issue and clearing the cache is not working for me. Neither is saving the view and then going back in to edit it.
Comment #25
Anonymous (not verified) commentedBest issue title ever, googled "custom date format views" and BOOM, done.
RE: #24 make sure you assigned the custom format to have a format type on this page: /admin/settings/date-time/formats/configure --- and then again clear your cache
Comment #26
Melissamcewen commentedClearing the cache did not work for me, but opening up the CCK content type and saving it did. Strange.
Comment #27
danny_joris commentedClearing the cache does not help for me. I also don't have a cck date field enabled - I don't need that. I need my custom date format to show up in the 'node: post date' field.
Edit: just as a test, I added a cck date field to my content type. Here I can perfectly select the new custom date format. Both in the cck field and views. In views I placed this field above the 'node: post date' , but 'node: post date' still does not show me the custom date format.
Comment #28
geerlingguy commentedSame as #26 - clearing cache didn't work, but re-saving content type worked like a charm.
Comment #29
Jo_ commented+ subscribe
As #26, re-saving content type worked for me. Wasted hours trying to fix this yesterday. :/
Comment #30
arlinsandbulte commentedJust a quick note: this is still valid for Date 6.x-2.6 & today's -dev
It seems clearing cid 'content_type_info:en' in table 'cache_content' is all that is needed to fix this.
Comment #31
arlinsandbulte commentedComment #32
zkrebs commentedI might have old code, but I just edited the content type's field and hit save, then it worked.
Comment #33
adellefrank commentedI could not get this to work with my content type's default field for created date. So, in Views, I did the following for the post date field:
Comment #34
korven commentedThis is still an issue with Date 2.9. Clearing the cache works and lets you see the new date format in Views.
Comment #35
Carolina Tiger Rescue commentedI found under Regional and language where I could set up the custom date type, but the format I need is not listed as one of the options. I just want the "time" value of the date to use in the month view of a calendar- so that the date is not taking up space when the date can obviously be seen in the month layout of the calendar.
What am I missing here?
Comment #36
Carolina Tiger Rescue commentedI figured it out- you go to COnfiguration- Regional and Language- Date and Time, then click on the "Formats" tab. Add the php format code, e.g. n/d is the format I use to create a date type of Birthday. Then go back to the types, Add Date Type- and then choose the example format you just created on the Formats tab and give your Date Type a name.
I did this in Drupal 7
oh, and BTW, I also created a type by editing the includes/dates.inc file, but think the method described above is obviously the way to go
Comment #37
damienmckennaUnfortunately the Drupal 6 version of the Date module is no longer supported. That said, we appreciate that you took time to work on this issue. Should this request still be relevant for Drupal 7 please feel free to reopen it. Thank you.