Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
There are times, like when creating an intraday event type, when you want to have a field that is just a time and not a date. Would this be more appropriate to put in a new module since the date module uses the ISO date standard to store data? Is there an ISO time standard?
Obviously this could be done by simply choosing a random year/month/day and store the time as a date. Then it would simply be a matter of not displaying the year/month/day in the drop down menu to set the time. However, this feels like an awful hack.
Steven
Comments
Comment #1
KarenS CreditAttribution: KarenS commentedYes there is an ISO time standard and we're already using it, and yes an iso format with no date would be the way to store a time-only record. I have to think about this though since many functions in this module make the assumption that you're creating something that really is a date and you're proposing something that is not, so I'm not sure how many things would need adjustment for this to work.
Comment #2
nisguy CreditAttribution: nisguy commentedI'm posting within this issue because it seems related.
I have been trying to get familiar with CCK and the Computed field, and in one of Agileware's examples he uses your module in the following context:
The problem that I am having is that your module doesn't seem to allow a field that records only hours and minutes. Am I misunderstanding something here?
I'm trying to put together a timesheet application at my company where users would update their schedule and the totals could be computed.
Any help would be apprecieted.
Comment #3
KarenS CreditAttribution: KarenS commentedYou are correct that currently the 'year' field is required. This is partly to make validation more manageable, and partly because I have trouble understanding why a 'time' would not also have a 'date', which is why I haven't been in any particular hurry to do anything about this.
In your example, a timesheet, the 'times' do have dates, you just may prefer to display only the 'time' portion of the date, which you can do now. You have an almost unlimited amount of control over the display (open up your 'advanced display options'), so you can set your field up to display only the time, and you don't need to create a date that has no time.
Anyway, if there is a reason to create times without dates, one of the biggest challenges would be to think through a system that can be used to validate results. Currently I make a date out of what is returned and then check if it is a valid date using php date functions. If that can't be used, validation gets much more difficult. If you have a good use case for creating times without dates and you want to try to make a patch to adapt the module not to require a date, I'd be glad to review it, but creating something like this is not very close to the top of my TODO list, and you'd still need to convince me that it is really needed :-)
Comment #4
nisguy CreditAttribution: nisguy commentedThanks for your reply, but I was able to adapt the regular text integer field to do what I needed. I guess what threw me was that example didn't explain very well how to setup the date field.
It makes sense that times should be attached to a year, but in my timesheet example, I intended the 'end of schedule period' date to be chosen at the top of the form and the times to be entered would be assumed to correspond to days of the week (sat-fri) within that period. Clearly, my app is not that sophisticated.
Thanks for the module.
Comment #5
raintonr CreditAttribution: raintonr commentedI was looking for a way to record a time (duration) without a date. Ideally would want to highlight Hour/Min/Sec in the 'granularity' box and record just that.
Why? Because on a sporting site, we have a number of 'challenges', and users can report how they've performed on each. How they went is entered as a node - which has a noderef to the original 'challenge', their comments, etc, and of course the time taken to complete.
I know one could use a text field and some sort of PHP validation that is in the form "HH:MM:SS", but it would be nicer to have a proper field here.
Another alternative would be to have an integer field with number of seconds, but again, that is horrible for the user.
If this could be stored in the database as an integer (or decimal for those people who might need this - we don't, but someone might) number of seconds but formatted "HH:MM:SS", or "MMM:SS", or "SSSSS.ss", or whatever I guess that would cover most scenarios.
If any other options sound easier, or there's another way, would love to hear.
Thanks :)
Comment #6
thomie CreditAttribution: thomie commentedRaintonr,
if you (or others) are interested in a module for recording 'durations', you can send me a message. I needed the same thing, and build a cck duration field type recently. You can select years/months/days/hours/minutes/seconds from a granularity box, and the data is stored in ISO format for duration. For example P1Y2M3DT4H5M6.78S would be 1 year, 2 months, 3 days, 4 hours, 5 minutes and 6.78 seconds. But any of these could be left blank, so years is for example not required as in date module. Note that the number of seconds can be a decimal, the other elements are integers. A duration field is optionally stored as seconds as well, which can be used for computations. For displaying: either the above ISO format, the number of seconds, or HH:MM:SS for time durations can be used.
Comment #7
rjleigh CreditAttribution: rjleigh commented+1 for time without date feature
"... you'd still need to convince me that it is really needed :-)"
I understand this is not a priority for you, but there are several areas where I would find this extremely useful. I'd like the option to create schedule-like dates; i.e. a date item that refers to 1-3pm each day in a range (as opposed to a start date with 1pm through the end date of 3pm) - I know that that can be accomplished with multiple entries, but that would be a chore in my case.
It could then be further abstracted for scheduling, say wednesdays from 1-3, or second thursdays from 1-3. I can build this separately, but it seems like it should be here.
I'm looking for this in the 5.x version, BTW.
Comment #8
rjleigh CreditAttribution: rjleigh commentedthinking a little further on these lines:
Now, I understand the desire to use standard strings for php validation, so couldn't a time entry be an ISO date that has just a year and time? (I'm not sure where that config would be valuable otherwise, so it might not even need further type-marking).
The year could essentially be discarded for display, or calculation with Y-M-D only dates. So, I can create two time fields, for instance, showing a 1-2pm slot, and they can be combined with an array of single Y-M-D entries to create a schedule (for a lot of entries, that would be more efficient). It would easily allow skipping days, but not require completely separate node entries for multiple occurrences.
If an end time is later than a start time, a +1 day could be inferred (to cover time ranges past midnight).
I can't imagine that more people wouldn't find this to be a highly valuable addition to an already important mod.
Comment #9
nadavoid CreditAttribution: nadavoid commented+1 for time without a date feature.
The reason I would like this feature is, I am creating a list of meeting groups that will meet regularly for several months. The start and end dates are not known, but the meeting time IS known. So I only need to record the meeting times, and it should be a time of day, not just a duration.
Other examples of use cases would be anything that involves a time, but no specific date.
- What time do you usually get up?
- What time are most of your rehearsals?
Comment #10
KarenS CreditAttribution: KarenS commentedI'm postponing this until the 5.2 version is working. I think that the way I'm using FAPI and the PHP 5 date functions in that version will simplify the code enough to be able to try to add a feature like this in (probably as an additional, optional module instead of as an add-on to the Date module).
Comment #11
rjleigh CreditAttribution: rjleigh commentedThanks Karen;
when you do get the time to look at the code, I'd be glad to test things.
-Roger
Comment #12
KarenS CreditAttribution: KarenS commentedNew features won't be going into 4.7 any more.
Comment #13
KarenS CreditAttribution: KarenS commentedMoving this to HEAD. No new features will be added to the 5.1 version, but it could be considered for the 5.2 version now in HEAD.
Comment #14
rweait CreditAttribution: rweait commented+1 for time duration.
This duration data type is useful for describing multimedia and events.
Media like video clips, TV shows, films, music, advertisements often see duration as important. Am I looking for a 15 second drum loop, or a Wagerian opera? Can I play a 30 second commercial, or the full minute?
The duration of an event matters, even before it is scheduled for a specific day. Is a training course two hours long or fifteen minutes? Which appointment do I schedule in the remaining time before lunch on Thursday?
Durations are an important parameter of these items and others.
Comment #15
jpetso CreditAttribution: jpetso commentedSubscribing, as I'm currently working on a generic "duration" element/field. I don't have high ambitions though to make it integrate with the Date module, it's just going to be a simple widget for displaying a time value (e.g. "3.5") and metric ("days"). Let's see how far I get. No idea if that's what's planned here, or if it should possibly be operating under the Date module family umbrella.
Comment #16
jpetso CreditAttribution: jpetso commentedOk, I added an initial version of my module to drupal.org, named Duration. Still without CCK features, which means that only developers can make use of the form element at the moment, and nice formatters are not implemented yet. The editing widget might also not fit your needs yet - it's currently a value/metric duo as described in the previous comment, or alternatively a single dropdown with fixed duration options to choose from.
Extending the element to suit your needs should be pretty easy though (for developers), as most of the groundwork is there. In comparison to the former version of this form element (which was only used privately in my Temporary Invitation module), I seem to have got the data structure right this time - reading the comments and use cases here played a good part in this, too :)
The issue for storing generic duration data is that you can't really express it as time deltas (that is, seconds) because once you reach larger units like months and years, those do not necessarily have similar length (31/30/28 days for a month, 365/366 days for a year). If I want to schedule stuff so that it happens exactly in a month, on the same day as today, the time delta approach falls down.
What I'm doing now is to take the mktime() parameters - seconds, minutes, hours, days, months and years - and store them separately, with a set of helper functions to ease the display and management of that data. Plus milliseconds, because exact demands like for video and audio media could make that necessary.
So, like it or not, depends. Anyone who wants to help out is invited to contribute!
Comment #17
Will Kirchheimer+ 1 for this feature
Looking to add time to-from to an existing module that only supports Date of occurrence (station playlist)
The module as built is more interested in the current schedule of a station, and then the date of the actual playlist. (less archival than my goals)
Having time only would allow me to interact with my needs for the module without having to interfer with the designers vision.
While still limiting the wear-tear on the Djs, avoiding multiple data entry repetition, and of course limiting chances for user input error.
Comment #18
Will KirchheimerWell, I guess there is this then: http://drupal.org/project/cck_time
Comment #19
will_in_wi CreditAttribution: will_in_wi commented(subscribe)
I want the ability do month/day but not year, because I have a site that has the birthdays of the teens show up in a block. I do not want their ages also showing up. Right now I use a custom php date format. What would do this for me is to allow me to only prompt the user for a month and day and then use my existing php date format. The date module would just add the current year and then ignore it.
Comment #20
jpetso CreditAttribution: jpetso commentedOk, so the Duration module (actually it's three of them now: API, form elements, CCK field) has been completely reworked and now features a working CCK field, but also a reusable PHP object that can be used for parsing ISO 8601 duration strings. If you want to have a duration field (as opposed to "time on any date" as with the cck_time field above), you might actually like it. If you don't like it, it's probably easy to add the features that you need to like it.
Check out the new release 6.x-0.9 and enjoy! Given that there's now a module for each of the use cases, should we close this issue?
Comment #21
rweait CreditAttribution: rweait commentedThank You * 1000 !
Comment #22
newbuntu CreditAttribution: newbuntu commentedI am bit confused!
I was able to do time without date with version 5.x-1.8. I updated to 5.x-2.0-rc, now it broke my app. I get an error message "A valid date cannot be created from".
I wonder if the way I made it work was just an accident! This was how I did it with 5.x-1.8: I just put "h:i A" in "custom input/display format", then checked granularity with "hour, minutes" only.
Can any expert throw in some comments?
thx!
Comment #23
alexanderpas CreditAttribution: alexanderpas commentedpulling this from postponed - see #10
Comment #24
Chris Przybycien CreditAttribution: Chris Przybycien commentedI'd like to support this feature request as well. I'm putting together a local music scene site and every gig we list has a separate "doors open" and "show starts" time. Currently one must enter the date of the show for each time and it leads to incorrect gig listings due to user input error. The ideal would be to have a single "show date" field then two time-only "show starts" and "doors open" fields.
Comment #25
jasontanner CreditAttribution: jasontanner commentedI'm struggling at the moment with how to implement a Time only field that would be usable as search criteria which had an explicit Date & Time element.
e.g.
Lets say you had a node type "Shop" and that shop had different opening/closing hours on different days of the week. There is not necessarily an explicit Date component here - at least not in the definition of the Shop node.
But ..
If I then wanted to create a view that let people search for Shops of a particular type that are open:
1) Now
2) Or on a particular Day of the Week at a particular time
3) Or at some future date
Then of course Date does come into play as well as time.
I had some ideas but ran in to the problem of there being no Time only field type to play with.
I'm sure others have run into this sort of scenario so was wondering how they might have solved this.
Comment #26
jpetso CreditAttribution: jpetso commented@jasontanner:
Your use case isn't the classical use case for a time-only field as it only applies to some dates in a given week. In my organizer application, stuff like this would be handled by recurring events. I'm not sure whether the Date module supports recurring dates at all, but if any module is going to do this kind of stuff properly then it will likely be Date.
There's also an Office Hours module which seems to meet your description, although I don't think the requested search facilities are available there either.
Comment #27
cyberskier CreditAttribution: cyberskier commented+1 for this feature.
I have a gaming site where users input the normal starting and ending times of their games, which occur each week at the same time. I don't need a long list of repeated dates (which is what is generated by this if the "repeat" option is selected, and I don't have the know-how to change that, although I'm learning). Right now I'm using CCK Time, and I've tried Office Hours, but neither of those seem to account for user timezones, so right now I just have everyone enter times using GMT.
Comment #28
kenorb CreditAttribution: kenorb commented+1 for the office_hours module
and +1 for this feature
Comment #29
TimG1 CreditAttribution: TimG1 commentedanother +1 for this feature. I'm trying to make a class schedule in my case. Something like...
BUS101
M: 12:00pm-1:30pm
W: 3:00pm-4:00pm
F: 12:00pm-1:30pm
Also, found this discussion about the same request.
http://drupal.org/node/202581
-Tim
Comment #30
fenfe1 CreditAttribution: fenfe1 commentedHi, I to am trying to add the ability to only show the time for a datetime field.
At the moment a user is asked for the hours and minutes for an event (via dropdowns).
when saved this shows up as the time but with 1st January 2009 at the begining.
I understand that there is a way to only output the time (I don't care about the date but, I just want to hide it), however I can't find a way of doing this.
I am running the latest version of this module (and CCK) for drupal 6.
The field I am using is of type `Datetime' and the widget type is 'select list'.
I can't find any kind of advanced options anywhere, and I can only choose from; short, medium or long for the display type.
Can anyone tell me if / how this can be done?
Thanks.
Comment #31
cyberskier CreditAttribution: cyberskier commentedUnless there has been a development of which I am unaware, this module doesn't currently support that. Although, I wasn't aware that it was possible to even input hours and minutes without the date (let alone then display just hours and minutes). Maybe somebody a bit more knowledgeable than me can chime in.
Comment #32
Gerald Mengisen CreditAttribution: Gerald Mengisen commented+1 for this feature.
We have an annual 4-day event, but not always at the same date. So for the planning, we simply use Day 1, Day 2, etc. and use time only for planning our volunteer slots.
CCK Time did exactly what I needed (http://drupal.org/project/cck_time), but there is no Drupal 6 version....
Comment #33
EclipseGc CreditAttribution: EclipseGc commentedAgain a big +1000000000 for this feature. The features of a date_popup limited to 'H' is really nice when you JUST need the client to select a time frame. Using manual select lists isn't nearly as nice :-D
Comment #34
tpainton CreditAttribution: tpainton commented+1.
Since drupal doesn't have any good scheduling/booking modules that suit my needs.. (yes I have looked at all of them (open resort, reservation, booking time slots etc) I am trying to hack my own using rules and views.
Basically, I need a set of nodes that represent time slots, for example, "18:00 - 18:30". References from that node to a user represent a booking. By using views, I can limit a user to only slots (nodes) that do not contain a user reference to someone else. I could use a generic text field, but it would be nice to lay these nodes out onto a day view in the calendar. Thus, creating a schedule.
The only thing stopping me is that I can't use time only. Yes, I know I can create a format that displays only the time but the site is set up in such a way that the end user is the one who creates the time slots and therefore, the inclusion of a date is going make things complicated for them. They will likely feel they have to create time slots for every day, when in fact, they don't.. They are used over and over again each day when a cron runs clears the time slots every night at midnight.
So, yes, a time only field for Drupal 6 would be GREAT!
Comment #35
Gerald Mengisen CreditAttribution: Gerald Mengisen commented@tpainton
The CCK Time module has a Drupal 6 port at http://drupal.org/node/263116#comment-1854704, and that might be sufficient for now if you don't need timezone support.
Ultimately, I also see the future of a time-only field in the date module, taking advantage of all the work that has already been done in this area. I might try to come up with a patch by the end of the year.
Comment #36
paganwinter CreditAttribution: paganwinter commentedSubscribing...
Comment #37
arlinsandbulte CreditAttribution: arlinsandbulte commentedPersonally, I question the validity of adding the feature to the _DATE_ module. I think perhaps a seperate field type of time duration might be more appropriate. (And I think that module might exist already)
This would reduce the complexity of the date module (it is complex enough the way it is!)
and
The time duration module would be relatively simple (just storing a duration does not introduce any timezone or other conversion complexities)
The date module is designed to specify a specific moment in time, and does so pretty well. Granularity settings start at year and go down.
A time duration module should specify a specific length of time. Granularity settings start at second and go up (for smaller than second times, second becomes fractional).
Then, as a seperate feature, I think time duration could be / should be integrated into the calendar module:
Instead of only specifying start date and end date for events, a start date and time duration could be specified instead.
Comment #38
arlinsandbulte CreditAttribution: arlinsandbulte commentedJust to clarify, this time duration could be a module packaged with the Date module. It would just provide a cck field type of "Time Duration"
Comment #39
arlinsandbulte CreditAttribution: arlinsandbulte commentedNote: This issue is related to #127200: Allow user to specify duration (relative) or end time (absolute)
It is not really a DUPLICATE, but I think these two issues could have the same solution by creating a new field type of "Time Duration"
Comment #40
jpetso CreditAttribution: jpetso commentedJust a reminder: there is already a field called Duration, and it's linked further above in the comments of this issue. I won't say it's the best maintained field ever (sorry), but it's got all of the code foundations that you need to work for duration stuff. Let me also stress that "duration" and "time without a date" fields are fundamentally different types of fields because they need to specify and store data in very different ways.
Comment #41
bomarmonk CreditAttribution: bomarmonk commentedA time field would definitely be useful. It seems like the date module is already doing everything that's necessary for a time field, but the module simply needs to treat a time field as a special case that does not have a year.... and cck time does not work with content multigroup, which prevents me from using it for an office hours multigroup.
Comment #42
cafuego CreditAttribution: cafuego commentedI'm looking for a time without date field for conference scheduling.
I know I can store a complete datetime for both session start and end times, but that leads to a lot of administrative overhead and less flexibility when querying the data.
I plan to have a 'session timeslot' node that has a both start end end times associated, but not dates; these would be stored in the 'conference day' node type.
Finally, a session contains a nodereference to both a date and a timeslot (and a room, but that's beside the point)
Being able to refer to refer to a timeslot via only a nid makes the underlying code less complex, and by not allowing the schedulers to freeform enter date and/or time information on each session, but only select a day/date and timeslot node, I can more easily prevent data entry errors.
I'm having a go of using the Duration module to get a workable solution, but having a Time field (that also supports Token) would make life far easier.
Otherwise I'll probably have to add an integer field and do some mangling of input fields, validation handlers and display to convert 16:45:00 to 25740 and vice versa.
Though the tag on this issue says 7.x, a 6.x version would be better ;-)
Comment #43
emattias CreditAttribution: emattias commented$i++ on being able to enter start and end time without having to enter year and month.
I only need day of the week(mon-sun) and start and stop time. The Fields contain businesses opening hours.
To prepare for a possible implementation should i have my current date fields be datetime or date?
Comment #44
StevenSokulski CreditAttribution: StevenSokulski commentedSubscribing.
Comment #45
bomarmonk CreditAttribution: bomarmonk commentedCheckout quicksketch's work on the CCK Time upgrade to Drupal 6. I've tested his module and it works pretty well (with mutigroups, etc.), although there is no official project page for it. Anyone interested in taking it to the next level (who really needs time without a date) might have a look here: http://drupal.org/node/263116#comment-2305898. It probably needs to get renamed to Time Field, or something like this, to prepare for Drupal 7.
Comment #46
Moya CreditAttribution: Moya commented+1 no necessity for year granularity
PROJECT: Input of mating seasons of animals. Therefore there is no starting year as with a birthday.
USER INPUT: from month - to month via 2 dropdown lists.
PROBLEM: I need to reuse the inserted dates with
- The search function: If the user inputs "March" "May" and someone searches "April" he will find the node with "March to May"
- Timeline
- Sorting in Views
Comment #47
Maedi CreditAttribution: Maedi commentedAlso +1 for no year requirement. I have a use case very similar to Moya's.
Comment #48
geerlingguy CreditAttribution: geerlingguy commentedI'm tracking this issue in relation to a problem I'm having trying to allow users to filter views results based on a start/end time (unattached to an actual date): http://archstldev.com/node/61
+1 for not requiring a timestamp with a year... however, I might work with another developer to patch/upgrade the CCK Time module so it will serve our purposes (which might be outside the scope of the Date module (since 'date' seems to imply an actual date, rather than an arbitrary time.
Comment #49
Exploratus CreditAttribution: Exploratus commentedsubscribe
Comment #50
rjbrown99 CreditAttribution: rjbrown99 commentedI worked around this. I wanted a date setting with only FROM and TO in hours and didn't care about the year. In the field settings, I did this:
1) Set both default values to relative.
2) Customize default value:
today 8am
today 5pm
3) Granularity:
Year
Hour
Now my form has two values, year and hour. But the year is already pre-populated as the current year because of the default value. At that point, I just hid the year with CSS display: none. As far as date is concerned, the year is present so it meets the requirements. As far as the user is concerned, they now see no year on the form.
Comment #51
mattbk CreditAttribution: mattbk commentedSubscribe.
Comment #52
doublejosh CreditAttribution: doublejosh commentedI actually had problems with the #50 solution from @rjbrown99, I couldn't seem to get the hours to pass through the strtotime.
It always sets the relative time to now. Tried "today 15:00", "yesterday 15:00" and "yesterday 3pm" as well.
Can't even seem to get it by setting a wide year range and hard coding the date time string to a year.
Comment #53
helmuthj CreditAttribution: helmuthj commentedHi everyone,
I am new to drupal and not able to fully understand what has been said with respect to this apparently still open issue. What I understand is:
1.) Many people have things like events happening at some time (opening of doors for a concert, end of mating season, etc.) for which it is not practical to enter a date.
2.) The date module is currently "unaware" of this common situation and complains whenever e.g. a year is not being entered.
3.) It is straightforward to change the way dates (year,month,day,hour, ...) are displayed - this is standard usage of the date module.
4.) It is equally straightforward to change the way dates are entered (e.g. specify "H:i"). This particular example, however, results in an error message and leaves the field value not set and hence not usable.
Now, I see a few suggestions for workarounds, some of which probably only apply to older versions of drupal. Modules that do not seem to work for me (a drupal 7 user) are
1.) cck_time
2.) duration
I guess these require a feature that is now longer present in drupal 7 ("content" module?)
I have seen proposed solutions here and elsewhere using the date module but I was unable to make any of those work. I would greatly appreciate something like a wrap-up on the current status of this issue with, if it exists, a detailed step-by-step solution. I'd be totally happy with a year being set to some default value automatically and the time being entered by the user.
Thanx,
Jo
Comment #54
jox CreditAttribution: jox commentedSubscribe.
Comment #55
donpwinston CreditAttribution: donpwinston commentedGood grief, why in the world would you want to force a content manager to enter the year when all that's needed is the time?
Comment #56
doublejosh CreditAttribution: doublejosh commentedMy use case is "Checkin Time" for hotels and B&Bs. Repeatable availability times or daily business open/close times would be more examples.
Again, I've tried to accomplish by pre-populating it and hiding it, but it didn't quite work: http://drupal.org/node/104287#comment-4502312
Comment #57
webankit CreditAttribution: webankit commented+1
Comment #58
mstrelan CreditAttribution: mstrelan commentedsubscribe +1
Comment #59
jbiechele CreditAttribution: jbiechele commentedsubscribe +1
Comment #60
tko CreditAttribution: tko commented+1
Let's get this feature rolling.
Comment #61
MichaelCole CreditAttribution: MichaelCole commentedBump and subscribe
This is useful for describing when a school class meets:
E.g. MWF 10am
Comment #62
cafuego CreditAttribution: cafuego commentedTurns out that HTML5 has a time form field that takes HH:MM style input. It would be good to be able to store that in a way that makes it easy to do time based calculations on. MySQL and PgSQL support this as a field type (sadly sqlite is difficult)
Comment #63
keithm CreditAttribution: keithm commentedsubscribe
Comment #64
brz CreditAttribution: brz commentedsubscribe
Comment #65
cafuego CreditAttribution: cafuego commentedI've started on a sandbox project; http://drupal.org/sandbox/cafuego/1264216
There's a problem with Drupal 6 not understanding the TIME column types in mysql and pgsql. There doesn't appear to be a way of adding these either. So I'm having to store the time as DATETIME by prepending '0000-00-00 ' to the input when it's stored and stripping that off again when the time is retrieved and displayed.
Currently it can store the time, display the time in 24h and am/pm format, as well as in hours, minutes or seconds only. It can grab and display the field (optionally with multiple values) in Views and do basic string-based filtering on it.
There is no advanced views integration with time-specific argument and filter handling and no way of combining say a date+time field to create a full DATETIME for display. I'm trying to adapt what exists in date_api, but patches are of course always welcome :-)
Comment #66
soulston CreditAttribution: soulston commentedI have had to work on a few event sites and often I want to add an event that starts at 10pm on a Friday and finishes at 4am on the Saturday. On a calendar this would be listed as covering 2 days which is not really what I want. Ideally it would be great to have an option of having a single start date and a start and end time field.
Does this exist?
Comment #67
facal CreditAttribution: facal commentedSubscribe. This feature would be great also for me. I need users to be able to select a hh:mm:ss to specify at which point of a video they uploaded something important happens.
Comment #68
jnettikThis feature would be great for something I'm working on. I have a bunch of seminars that I'm displaying in a table grouped by date. Problem is if I include time, each seminar has a unique time and therefore doesn't group them on date.
My solution is to create a field for the date, that I can group by and another field for the time. For now I'll probably use the solution mentioned earlier of just hiding the year field with CSS but it would still be nice if there was a cleaner solution.
Comment #69
doublejosh CreditAttribution: doublejosh commentedLooks like there is a Drupal 7 Partial Date module being worked on.
Comment #70
bjcooper CreditAttribution: bjcooper commented+1 for time-only field
I'd also find an actual time-only field handy. I'm doing stuff like room scheduling where users can search for openings at a specific time across many days. I do a query filter with the start and end times only. In the mean time, I think I might just hide the date field...
Comment #71
iantresman CreditAttribution: iantresman commentedHere is how I solved the issue in Drupal 6, see "CCK: How to add and display a time span/duration". It's a bit of a kludge, which just defaults to the date 1 Jan 2000 for the year for all "times", and excludes the date when output.
But I seem to have a problem with using this "time" format in Views exposed filters, so it would make sense to have a date/time option that ignores the date completely.
I had hoped I could just define an integer, and then use a widget that forces entry as 37:20 (ie 37 mins, 20 secs), but stores everything in seconds. Or allow a decimal where 37:20 uses a colon instead of 37.20, but I couldn't figure out how to prevent the decimal part being greater than 59.
Comment #72
donpwinston CreditAttribution: donpwinston commentedThere is some technical issue or else the developer would have done this long ago. It makes no sense not to do it.
Comment #73
cafuego CreditAttribution: cafuego commentedSetting issue status back to active. Please don't close it based on unfounded assumptions.
Comment #74
donpwinston CreditAttribution: donpwinston commentedoops. This thing shows up under "Your Issues" meaning me? I was cleaning up all of "Your Issues" (My Issues) and closed it. Sorry.
Comment #75
Les LimIf you click on the "Following" button at the top of the issue post, you can remove it from the list of issues you're tracking.
Comment #76
cesareaugusto CreditAttribution: cesareaugusto commentedThis feature is exactly what I'm looking for. I got a Club node type. Of course it represents clubs. Each club has an opening hour. I would like to be able to have some kind of search option like "what's open now" and "what will be open on a given date/time".
I shall give Office Hours a try now. Anyone got updated tips on which would be the best practice to have opening hours?
Comment #77
chalda CreditAttribution: chalda commented+1 for this feature. I would really appreciate it.
Comment #78
rasheemo CreditAttribution: rasheemo commented+1 for time without year feature
Comment #79
pbfleetwood CreditAttribution: pbfleetwood commentedAnother use case:
I'm preparing our Beach Conditions page. Two nuisances:
1) The page's administrator will enter the times for high and low tides. There is no reason that he should be bothered to enter years and he will be annoyed.
2) I cannot hide the year and separator on the page, because there's no wrapper around them. The date is output as...
<span class="date-display-single">2012 - 8:34am</span>
Comment #80
johnv@cesareaugusto, check out #1606886: Current Status Feature
Comment #81
KarenS CreditAttribution: KarenS commentedMajor new functionality will go into the 7.3/8 branch we are just starting on.
Comment #82
Andrew_Mallis CreditAttribution: Andrew_Mallis commented+1 for time-only option
hh:mm:ss useful for videos.
Comment #83
grguth CreditAttribution: grguth commentedThere is an ugly but usable workaround if you just need the times independent of the date. For a time field you can create a char/text field (length of 7 or 8 is fine) and then when you build the form use a validation function which is a regular expression to validate the format. If you use a format of hh:mm am (or pm) you can still use the date conversion functions to do time arithmetic and convert back.
Comment #84
byronveale CreditAttribution: byronveale commented+1 here too - potentially a can of worms situation, using entity_reference, the date value would come from the referred-to node, but want to let content creators simply enter a time, not have to repeatedly (conference agenda, so can have six to a dozen items) enter the same date...
Thanks from me too for a truly awesome module, can't imagine Drupal without it!
Comment #85
Stolzenhain CreditAttribution: Stolzenhain commentedHello – this just to chime in – we use the timefield module on several sites to accompany date fields. It works pretty well so far – especially considering the differing use cases of times attached to events (e.g. opening hours).
Comment #86
dernetzjaeger CreditAttribution: dernetzjaeger commentedTimefield is indeed a great module, but in use with Forms API I can't find any validations like the time-part of date module has.
So a mix of both would be great.
Comment #87
Stolzenhain CreditAttribution: Stolzenhain commented… agreed! I guess, I'm also pretty much spoiled by the Views options date has to offer.
Another edgy case is encoding dates together with a custom time, especially when preparing data exports.
Comment #88
bunthorne CreditAttribution: bunthorne commentedChiming in for an ISO 8601 Duration format in the Date/Time module. Quoting from Wikipedia at the ISO_8601 page:
I am looking into Timefield, but I don't know that it represents data with ISO 8601 format--which is required to make use of the schema.org/Rich Text Snippets in search engines. I'm checking on that.
Comment #89
s.Daniel CreditAttribution: s.Daniel commented