Needs work
Project:
Date
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
7 Feb 2008 at 00:42 UTC
Updated:
26 Sep 2013 at 17:17 UTC
Jump to comment: Most recent file
I think it would be quite handy if the Date.module provided a Views field and filter for "Date: Duration" which utilized the option field as a way for users to specify a format_interval() $granularity or a custom date() $format.
Use cases I can think of:
I might have to end up doing it myself, but thought I would throw it out there in case it's already been done, or someone has already started and wants to share their code, or if someone wants to start before me. :)
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | time ago filter patch documentation.odt | 126.08 KB | Levin |
| #6 | date-timeagofilter-218736-6.patch | 1.63 KB | Levin |
| #6 | date_views_time_ago_filter_handler.inc_.tar_.gz | 10 KB | Levin |
Comments
Comment #1
Yura Filimonov commentedI second the request.
I want to be able to see the duration of a schedule event, a training session, for example, or a class. E.g. Starts at 9:00, 2 hours. Or, 9:00 - 11:00, specified in one field.
Looking for a better way to display it, too.
Thanks.
Comment #2
Passionate_Lass commentedThird!
Comment #3
Bevan commentedI have a kind of similar use case by which content items are proposed, unscheduled projects. The duration of construction is known, but not the start date. Valid entries for the content items are: "5 years", "3 months" "2.5 years", "4 years and 3 months". I would like to have these stored in a similar way to ISO date fields, in that I don't want a timestamp, which loses the granularity/precision of the input, and knows if the user input a number of years, month, or for that matter, days, seconds, minutes or hours. Is there a module that does this yet?
Update: Duration module fits these needs quite handsomely, and will suit some of the needs mentioned in this thread such as a "Please enter your age" field.
Comment #4
arlinsandbulte commentedThis is a duplicate of one or both of the following:
#104287: Time without a date feature
#127200: Allow user to specify duration (relative) or end time (absolute)
Comment #5
-Mania- commentedThis would be much needed. Date already has the possibility of displaying a date as 'time ago' when entering fields so why does it not have this in the filter settings? I'm exposing a date field to users and would like them to pick an age value instead of the date.
Comment #6
Levin commentedThis patch adds a new feature for the date module which does not exist in current Dev verion (7.x-2.x-dev, 2012-Sep-30). With this patch applied, we can configure “time ago” filter on date fields in views. Please note:
1. The "time ago" field on date fields in views is not implemented in this patch.
2. After applying the patch, you also need to unzip and copy the the file "date_views_time_ago_filter_handler.inc" to sites/all/modules/date/date_views/includes
Attached are the doc and code changes for this patch. Please let me know if you have any comments/questions while using this patch. I'll respond as soon as I can.