Posted by stevebayerin on September 19, 2008 at 6:27pm
I usually edit node.tpl.php to control how the submission date is displayed.
How about a drag and drop interface with date settings instead of fixed presets for users to select how the date is displayed?

| Attachment | Size |
|---|---|
| Drupal_date_format_v1_r4.jpg | 77.25 KB |

Comments
It looks nice! I like
It looks nice! I like it.
How about the 12/24-hr format?
I've been trying to
I've been trying to brainstorm what happens when the user chooses the hour format.
I guess as soon as the user drags the 2 (instead of 14) for the hours towards the top, a AM/PM block could appear in the upper section (the one with the preview) and the user can then drag that AM/PM box around or dump it in a bin/dock
Edit (to save subscribers an unnecessary extra E-Mail:)
Here's another illustration with AM/PM as an option:
The special options in the top block can only go active when specific trigger blocks (such as the hour block) are dropped in. The trigger blocks then activates their related special option blocks such as the AM/PM block for drag and drop. Special option blocks can be grayed out when the trigger blocks are not selected/dropped in.
I think the idea of an
I think the idea of an interface builder for this is great, but I think we should just make it a text field so that people can add things like "on XXXX at XXXX" This is just building a format string for date(), so I think it would make more sense to make AM/PM an option in the bottom, and let people add that just like anything else. No need for special code, if we are letting them build it, then they can handle getting all the fields they need in there.
AM and PM as a normal choice
AM and PM as a normal choice would be better then. A multiple use 'space' or multiple use
$nbsp;option could be added as well for spacing.I don't see this being
I don't see this being particularly more user-friendly than what we have now. The drop-down list with common formats is fairly easy to scan and quick to choose. So I definitely wouldn't replace that with an interface builder, which makes the process slower and adds a learning curve for people who may not care so much about the date formatting.
As a replacement to the custom format text field it's problematic, too, because to allow for the same flexibility the interface can quickly become cumbersome. For example, you need to allow for the option to insert any text at any place, not just some custom characters.
The main problem the custom field has is that the codes aren't readily available on the page and few people have them memorized. If you can find a way to drag and drop the format blocks into the custom format text field and they get inserted as the corresponding php format, then you'd have a nice solution I think.
selects are quick'n'easy
I agree with illuminaut that selects are a quick and easy way to pick the format you want. Hence, it may be nice to have a sort of builder separately, where you could add your "Custom format" and save it. Then it shows up in the drop down list.
So, how about having a separate link with "Add custom" that leads to/displays the builder, with a "Save format" submit button? Then I suppose there should be a remove of some sort...
I like the one here, but the date builder MUST also have a textfield for maybe formats that are not customizable with the basics. Like if you want something fancier such as "On the day of ... and month of " blah blah. Maybe enable some advanced string processing through PHP while we're at it? (for even fancier things like "the 1st of"?)
Not sure if this is the place to mention it, but is it possible to make the entire "Submitted by + author + date" part of the "submitted" div customizable? So that you can change the "Submitted by" text and the order of author + date, etc...
I can see what the both of
I can see what the two of you mean.
The original posts wording of "How about a drag and drop interface with date settings instead of fixed presets for users to select how the date is displayed?" would be better off written as: "How about a drag and drop interface for date settings in addition to fixed presets."
One trigger for the date and time builder to be activated is when a user selects 'custom format' in admin/settings/date-time with the current custom date text field editor above the newly opened builder in the event a user wishes to skip the builder.
Editing the "Submitted by + author + date" could be done in a builder since there is no hard coded text such as "submitted by" in the theme files. The builder could have the "Submitted By" block pre-built and removable if necessary. I assume instead of special characters at the bottom, another drag and drop ready text field could be used and re-used for new text based characters. A pre built 'Submitted By' in that case could be dragged out and replaced with a new text field containing "Authored By:" or "Authored By - "
(I'll build a mock up to illustrate what I mean by a re-usable drag and drop text field.)Edit:

The mock up's ready:
This looks better I think!
This looks better I think! Could the drag and drop textfield be at the top? (so you don't have to drag over the entire builder)
I don't get it either...
I don't get it either... Whats the advance between a dropdown and this? I believe it will be more confusing to dev rookies and hobby site maintainer.
Drupal Rocks !!!
disadvantages of dropdown
I think the disadvantages of the dropdown and the alternative option: using PHP syntax are the following.
-the list is quite long
-the list is non exhaustive
-if you need a non existing format you need to learn a weird syntax (for most users)
-you can't (afaik) do fancy date formats as "submitted on Tuesday December 31st '08"
Imho those are some big disadvantages.
I suggest using a pretty small list of default date formats and then optionally letting the user adapt those and save them as a new date format.
The small default list will probably be enough for a big percentage of users. The rest can then easily open a default format, fiddle with it and then save it as a new format. I think that way of treating the problem is a familiar pattern. I think Photoshop does stuff like that.
-Niels Bom
-Niels Bom
Where would this fit in?
Where would this interface fit in? On the general date/time settings page? This page has three date formats: short, medium and long. Would there be three forms on that page?
I agree with nielsbom. The current interface is too complicated and not exhaustive. E.g. The medium date format has 14 options, and the one we use in the Netherlands is not even among them. What we need is smarter defaults.
I've been thinking about this before (issue). Here is a mock-up, based on my ideas from last year:
I'm sure this can be improved. It is just to give a general direction. Consider this:
- Shouldn't 24h or 12h time formatting be part of the locale settings?
- And what about d m y / m d y / y m d?
My impression is setting those two would probably be enough for most users. True?
At least separating those two settings would considerably decrease the number of drop-down options currently available. I guess what's left is just the custom format, which gives advanced users enough to play with.
(BTW look at the top of the settings page, which is default Drupal. "User-configurable time zones: Disabled/Enabled" This is one of the silly things sutharsan talkede about during his Szeged presentation. My proposal: a check box labeled "User-configurable", right of the the time zone selector.)
Goal
My goal of creating the mock up is to allow for a more visual and click friendly system for users to customize the date display to their liking without having to know the PHP date format. Typing in the custom date display as its done now can work but I was looking for a more visual/ clickable way of selecting the date format.
As Einsicht also mentioned, allowing the user to customize the 'Submitted by' in an interface would be a benefit as there is no way (that I'm aware of) to customize the display the 'Submitted by' portion without editing node.tpl.php or page.tpl.php. I don't see why a user should have theming knowledge or hire someone with the same so that their posts could be personalized to have the submission section read similar to "Written by yours truly on 22-September in the year of 2008"
@einsicht, I can't think of a reason why the re-usable drag and drop textfield shouldn't be at the top. Now that I think of it, that should be the only part of the interface that needs to be drag and drop. The remaining options can be clicked on or off in the lower box instead of being only drag and drop.
+1 for making the default
+1 for making the default options smarter. Provide reasonable defaults based on a locale, and just focus on making the custom format usable without having to jump back and forth between the page and the PHP manual. I like the drag&drop idea for custom formats, but I'd simplify it dramatically:
Use just one text box with a bunch of draggable boxes underneath. Just the basics, no need for special characters like "-" and ":". Then the user can mix typing and dragging boxes into the text box. When a box is dropped into the text field it will be inserted at the current cursor position as the corresponding PHP identifier, i.e. dragging the "Aug" box into the textfield turns into %M.
The advantage of that approach is that the drag&drop is completely optional and the custom string functions like before. No need to change anything in an existing installation. Also, you can focus on the most common formats, and if people need something really unusual (i.e the timezone offset in seconds), they can still do it by entering the code manually.
Note that there is one caveat: the example strings in the boxes cannot be the current date and time, because there's a high chance of ambiguity in the format representation. You need to pick a date and time in history that is formatted uniquely. A vanity date like Drupal's birthday would work fine, except that Drupal 1.0 was released on the 15th of January 2001, and you'd need a single-digit day.
An alternative for a bunch of draggable boxes, which could take up a lot of screen estate, is to have a drop down list next to the custom format text field and an "Insert" button next to it. So you can select, say "Aug" from the list and click on Insert, and %M is inserted into the text box. Unfortunately it will be a bit difficult to factor in cursor position without a drag&drop, because there is no cursor once you leave the text box.
Solve the main problems
I like this idea. Currently the main problems - in my opinion - are:
1 can be solved by smarter defaults. Just set the order of the date/time components and you're done.
2 can be solved by providing draggable boxes showing examples of formatting of each component. Just one text box will keep it flexible.
Nitpicking, but...
Actually, the distinction is not between beginners and advanced users, it's between basic and custom use of the date format. An advanced user is just as likely to choose a basic format as a beginner, and the beginner benefits from an easier custom format entry just as much.
That's probably what you meant, but I think it's important to keep that in mind, so we don't have any wrong ideas about who the users are when designing it.