SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Zealot
    Join Date
    Sep 2009
    Posts
    118
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Drupal date format

    I don't really get the date formats in Drupal 7.

    How come every date seems to use the medium format? What's the point of the other formats, if that's the case? And how can I use a different format for different display instances, e.g. comments and articles? I can theme-override the dates, but I'd be happier (and it would be better for the clients) if I could get that customisation just with the UI settings.

  2. #2
    SitePoint Wizard bronze trophy
    Join Date
    Oct 2001
    Location
    Vancouver BC Canada
    Posts
    2,030
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)
    I've never changed the date format (short, med, long) in regular content except to change the way it's set up mm/dd/yyyy or dd/mm/yyy, etc... I have found it very useful to mess about with the date formats in my views though and that's where I think they are probably must useful.
    Andrew Wasson | www.lunadesign.org
    Principal / Internet Development

  3. #3
    SitePoint Zealot
    Join Date
    Sep 2009
    Posts
    118
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    How do you get anything other than medium to be used, though?

  4. #4
    SitePoint Wizard bronze trophy
    Join Date
    Oct 2001
    Location
    Vancouver BC Canada
    Posts
    2,030
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)
    Check out this thread ofver at Drupal.org: http://drupal.org/node/1075692
    Andrew Wasson | www.lunadesign.org
    Principal / Internet Development

  5. #5
    SitePoint Zealot
    Join Date
    Sep 2009
    Posts
    118
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    As I mentioned above, I can—and do—theme-override dates with no great difficulty (and simpler than the code at your URL). I just wondered (1) why the three date formats exist when Drupal seems only to use one of them for everything; and (2) why there is apparently no option anywhere to pick a date format for each content type. Which is a totally dumb omission.

  6. #6
    SitePoint Wizard bronze trophy
    Join Date
    Oct 2001
    Location
    Vancouver BC Canada
    Posts
    2,030
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)
    I expect the reason they have 3 formats is so that you can take advantage of them with customizing. ie: modules or theming. As I mentioned earlier, I sue this often with views when I add a date field to a content type and then create views for that content.
    Andrew Wasson | www.lunadesign.org
    Principal / Internet Development


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •