Closed (fixed)
Project:
Drupal core
Version:
7.x-dev
Component:
forms system
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
13 Nov 2005 at 05:49 UTC
Updated:
3 Nov 2009 at 17:26 UTC
Jump to comment: Most recent file
Comments
Comment #1
tatien commentedActually, what would be nice would be that the "date" type be "formatable" with options, so that you can choose how you want to specify it (e.g. just the year, a month and a day, just the hours/minutes/seconds, with select boxes or with a sring timestamp, etc.)
Comment #2
webchickTrue. Features only go against the next dev release though.
Comment #3
derhasi commentedFor my custom module I developped a datetime element type. It extends the features of the date element type.
With specific options for each element, you can select if it should be hidden. You can also set pre- and suffix for each child element, limit range of the select options of each child, customize the elements' order and assign a default_value different to the current time default.
You also get a lot more output on your field's value. It still contains the standard date-array with 'year','month','day' plus now for time: 'hour','minute','second'. Additionally it extends the array with 'timestamp', 'sql_datetime' (like it is used to save in SQL-tables' datetime), 'sql_date' and 'format_date'.
I attached the module's .module, which only will add this datetime element type.
Comment #4
derhasi commentedFor developing reasons I had changed the 'hidden'-type to 'textfield', now I set it back to 'hidden'. Sorry for that. Now it's ready to commit.
Comment #5
yched commentedYour patch needs reviews before it can be set 'ready to be committed' - usually not by the guy who submitted the patch :-)
Comment #6
derhasi commentedI created a forum topic on http://drupal.org/node/130694 to discuss about my datetime.module. There also a dev-version is linked for downloading.
Comment #7
ChrisKennedy commentedThis isn't a patch and it has some major coding style issues (http://drupal.org/node/318). It will need to be developed for Drupal 6, not 5.
Comment #8
karens commentedThis won't go into core before 7.x since 6.x is frozen. The new Date API (still in development in HEAD) will create a couple date_time elements, a date_select and a date_text (the date_text can use jquery-calendar or jscalendar popup widgets). They will be usable by any module in 5.x and 6.x (no dependence on CCK), and I hope we can get them into core in 7.x.
Comment #9
karens commentedAnd it isn't a patch yet...
Comment #10
wienczny commentedWhat is the current state about this?
Comment #11
wim leersSince CCK will be moving into D7 core, I imagine this *will* happen. But it probably won't happen until CCK for D6 is ready, at the least.
Comment #12
webchickNot sure... Date module is a bit of a different beast from standard text/number/etc. faire. Unless some people step up to help, this probably won't happen for D7.
Comment #13
karens commentedThe new Date version 2 has an API that *could* be partly moved into core for D7. I have a session to discuss that in Boston (http://boston2008.drupalcon.org/session/drupal-dates-we-can-do-better). The API includes some standard, configurable date elements like #date_select and #date_popup. Since D7 will require PHP 5.2, we can (finally!) use the new PHP timezone handling that actually works correctly.
If we have a good date API in core, I can then create a simple date field for CCK in core that could use it, and leave the more complex date handling in a contrib module.
Once the Date version 2 is finalized and ported to D6, I plan to submit a patch to add some of the API to core.
Comment #14
wim leersCleaning up the issue queue.