It is possible to add custom date formats at admin/settings/date-time/formats/add but once added it is not (AFAIK) possible to view or edit the custom date format, right? (The only possible action is to delete it.)

My feature request is that it is made possible to view and edit the custom date format.

By "view" I mean view the custom code, not the result of the code (which can be seen at admin/settings/date-time/formats/custom).

(I searched but couldn't find this feature request. Sorry if it's already exists.)

CommentFileSizeAuthor
#8 Screen shot 2010-10-18 at 05.47.09.png42.9 KBgagarine

Comments

YK85’s picture

+1 subscribing

gagarine’s picture

Title: Edit and view custom date formats » Custom formats are not editable
Version: 6.x-2.4 » 6.x-2.6

Edit is enough (you can view the format when you edit it).

I think the "add format" and "custom format" tabs can be merged. Like for CCK field we can have the form to add in the bottom of the page.

karens’s picture

Status: Active » Closed (won't fix)

That feature has gone into core for D7, and it looks pretty much like the same. There is no point in changing it here, it is probably best for this to stay consistent with the way it looks/works in D7.

AdrianB’s picture

So what you're saying is that you can't edit (or even view) custom date format code in D7 once it's saved?

karens’s picture

I'm saying that the way all this works has already been ported to core in D7. You are talking about changing tabs and functionality. I'm not planning to do that since adding features to D6 that won't be present in D7 makes no sense.

AdrianB’s picture

I understand. I was just curious about this new core functionality in D7, I have yet to install D7 myself.

gagarine’s picture

In D7 you can edit and delete format.

gagarine’s picture

StatusFileSize
new42.9 KB
AdrianB’s picture

Thanks gagarine! That's exactly what I wanted when I opened this issue.

(I probably misunderstood KarenS in #3, because I got the impression that my request was wontfix because it had to be consistent with D7 which implied that in D7 there was no way to view or edit the custom date code.)

karens’s picture

Status: Closed (won't fix) » Active

Well anything that is consistent with the way it works in core in D7 is fine. If someone wants to put together a patch I'd be glad to look at it.

iantresman’s picture

A quick workaround is to display the custom date format PHP format string, which for me, is the bit that takes time to figure out. I don't know how to create a patch, but here is a hack I did to do this.

In the file: date_api.admin.inc file, I added one lines "//Header" and changed one to "//Output format string too":

    // Get list of custom date formats.
  $formats = date_get_formats('custom', TRUE);

  if (!empty($formats)) {
    $rows = array();
    $rows[]=array("<b>Custom display</b>","<b>Format string</b>","<b>Delete</b>"); //Header
    foreach ($formats as $format => $format_info) {
      $display_text = date_format_date(date_now(), 'custom', $format);
      $delete_link = l(t('remove'), 'admin/settings/date-time/formats/delete/' . $format_info['dfid']);
      $row = array($display_text, $format, $delete_link); //Output format string too
      $rows[] = $row;
    }
    $output = theme('table', array(), $rows);
asb’s picture

asb’s picture

Version: 6.x-2.6 » 6.x-2.x-dev
Priority: Normal » Major

IMHO, 'date' module for D6 should keep the UI as close as possible to D7, thus it should be possible to edit custom date formats. So it'd be really great if someone would be able to write a patch for that.

For D7 there is currently no necessary requirement to show the PHP format code; for D7, this simply would be a "niceto have" UI enhancement as it saves the user a few clicks.

For D6 it's different as there are - as far as I know - no means at all to review the PHP format code of a custom date field. That's why I'd like to point some attention to the patch provided in #598346 as it targets this usability issue. Though, being neither able to review a field's configuration nor to edit it is quite far from being user friendly; it makes it unneccessary hard to debug a custom date format as the preview at ./admin/settings/date-time/formats/add might show a different output than when the format is used in a View [1].

However, the feature request (make custom date fields editable) probably should target the dev release (6.x-2.x-dev) as it would backport functionality from D7.

([1] Example: I want the calendar week plus year, and for that I'm entering W. \W\e\e\k Y at ./admin/settings/date-time/formats/add; the preview shows exactly what I want: 40. Week 2011. However, if I use the formatter in a View, Im getting something like: 49. Week 2011 49. Week.)

damienmckenna’s picture

Issue summary: View changes
Status: Active » Closed (won't fix)

Unfortunately 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.