Closed (won't fix)
Project:
Rules
Version:
7.x-2.x-dev
Component:
Rules Core
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
25 Jan 2013 at 13:22 UTC
Updated:
22 Jan 2020 at 22:43 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
David Stosik commentedHere is the patch.
Feel free to test and give me a feedback.
David
Comment #2
David Stosik commentedMy code breaks other actions, such as "Add a variable", but I don't know why yet.
Any help is welcome!
Comment #3
David Stosik commentedHere is a better patch, that does not seem to break anything.
David
Comment #4
fonant commentedPatch #3 works for me, and handy workaround for formatting dates as strings in rules. Thanks!
Comment #5
David Stosik commentedHere is a new version working on Rules-2.x branch, with a small fix concerning date custom format.
Comment #6
David Stosik commentedActually, previous patch was just a reroll. This one here fixes the custom date format field.
Regards,
David
Comment #7
4kant commentedDavid, I tried your patch #6 - it is exactly what I needed and works fine.
I needed to set an ISO Date value for a text field (to hand the string over to Facebook to post an event on a Facebook page via module fb_autopost)
Great job
Thanks
Comment #8
rbrownellComment #9
fagoThank you for the patch.
However, I'm not so happy with the increased complexity it adds to the data type conversion action. Also, I don't think formatting a date is something that should be handled in a date conversion action - it's way more than just converting the data type, it's formatting. So this qualifies as a separate action.
Note, that we have intervals as separate data types also ("duration"), so I think we shouldn't bake formatting durations into the same action either but use another one. I don't know whether core has any built-in duration formats, I guess not - in which case we'd have to roll our own as the patch does.
Comment #10
fagooh, and I forgot - we'll need test coverage for that.
Comment #11
jsibley commentedSo, please, where does this leave us? I would like to format a date to show only the date without a time.
If this patch won't be committed what solution is there?
Thanks
Comment #12
jsibley commentedduplicate comment by mistake
Comment #13
tr commentedThis can be done in D8 using Data Filters. See https://www.drupal.org/docs/8/modules/d8-rules-essentials/token-replacem...
I have already contributed more than my share to getting that implemented.
There doesn't seem to be any community support for doing this in D7 - it's been more than 7 years since anyone contributed anything to this issue, despite there being ~250,000 users of D7 Rules. So I don't see any need to keep this issue open any longer.