Needs review
Project:
Computed Field
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
2 Feb 2012 at 11:36 UTC
Updated:
19 Dec 2022 at 22:26 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
staff_whyte commentedI got around this by using rules to populate a date field.
Comment #2
jazznight17 commentedcould you explain me how did you do that please ?
Comment #3
staff_whyte commentedCreate your date fields in your content type, origionaldate and mynewdate
Create a rule to fire after saving new content or updating existing content.
Make it only happen on the correct content type using the condition.
Create an action that sets the value in mynewdate to origionaldate +/- your value, you can do it in various increments like minutes, days etc..
Comment #4
Gaofengzzz commentedI have some problem in my site, any other idea or patch?
Comment #5
colanSorry, this is out of scope, but yes, you can use hooks or Rules to act on a Date field.
Comment #6
nancydruI don't understand how this is out of scope. Clearly many people want this, me included. Requests even go back to 5.x. There are many reasons why date-type computed fields are valuable.
Comment #7
nancydruWithout this, Views filtering is not possible.
Comment #8
colanFair enough. Patches welcome!
Comment #9
jmuzz commentedHere's some date support. Briefly tested filtering and sorting in views.
Comment #10
markabur commentedHere's a reroll of #9.
I'm using this with views, search_api, and facet_api. The date facets work as expected, with the ability to drill down by year, month, and day.
Comment #11
ajlow commentedDoes someone have a similar solution for the the 3.0@alpha branch?
From what I can see, it seems it should be done by this method: https://www.drupal.org/docs/drupal-apis/entity-api/dynamicvirtual-field-... however I am having trouble having the field displayed...