Closed (fixed)
Project:
Token
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
12 Sep 2008 at 14:48 UTC
Updated:
25 Mar 2010 at 19:10 UTC
Jump to comment: Most recent file
I was adding tokens for the Web Links module, which has several dates. I borrowed on token_node.inc for this, but decided it would be even nicer if there was a function within Token to do this. So here's a patch (5.x and 6.x versions).
| Comment | File | Size | Author |
|---|---|---|---|
| #29 | 307520-token-dates-D6.patch | 12.72 KB | tobiasb |
| #26 | 307520-token-dates-D6.patch | 12.62 KB | dave reid |
| #8 | token6.patch | 1.62 KB | nancydru |
| #2 | token6.patch | 1.66 KB | nancydru |
| #1 | token5.patch | 1.53 KB | nancydru |
Comments
Comment #1
nancydruLet's add "-since".
Comment #2
nancydruIt would be simple enough to use this function to provide #179297: Tokens for minutes and seconds.
Comment #3
lomz commentedthe last one contains all?
Comment #4
nancydruIIRC, yes. If it works well for you please mark this issue RTBC.
Comment #5
lomz commentedComment #6
nancydruThis must be a Windows gotcha! It applies for me. Can you apply it manually?
Comment #7
lomz commentedNo, I think it is Ubuntu.
I'll try to add it manully
Comment #8
nancydruI created this version with CVS.
Comment #9
lomz commentedworks
Comment #10
nancydruI won't mark my own patch as RTBC.
Comment #11
lomz commentedOh, i meant the patch, I review it tommorow
Comment #12
lomz commentedI dont the the seconds, minutes and hours to show up wgen trying to set the submitted by text
Comment #13
christefano commentedI don't think this should be in token.module. The place for node tokens is in token_node.inc, which is what #323441 add timestamp tokens (g, G, h, H, i, s, U) for hours, minutes and seconds targets.
Comment #14
nancydru@christefano: Take a look at the patch. This does not create tokens itself. It is a function to format dates and times to be used for creating date and time tokens. It is generic, and the only place it should be is in the base module.
Comment #15
lomz commentedBut since I need tokens for hours minutes and seconds they need t be created dont they?
Comment #16
nancydruYes, there should be a patch for token_node (and the others) that uses the function from the patch in this issue.
Comment #17
lomz commentedIs that hard to make?
Comment #18
nancydrutoken_date_values($comment->timestamp, 'comment');Comment #19
lomz commentedBut how to transfer that into token_comments?
Comment #20
donquixote commentedwhat's the status here?
Comment #21
donquixote commented@lomz(#19):
"But how to transfer that into token_comments?"
becomes
(array keys are all strings, so this array arithmetics should work)
Comment #22
donquixote commented@NancyDru:
I don't see hours and minutes and seconds in your patch..
Comment #23
christefano commentedThose are proposed by another patch (#323441: add timestamp tokens (g, G, h, H, i, s, U) for hours, minutes and seconds). Perhaps the two different issues should be merged.
Comment #24
nancydruWell, the maintainers are too busy putting this into core for D7 to do anything here.
Comment #25
summit commentedHi, issue with time function on token_node.inc, line 48, latest version.
Greetings, Martijn
Comment #26
dave reidHere's the patch I had made up before I even saw this issue to help reduce even more code.
Comment #27
christefano commentedPatch applies with slight offset with token_node.inc. Looks good to me.
Comment #29
tobiasbuse format_date (#433486: Use format_date() for translatable date tokens)
Comment #30
dave reidCommitted to CVS. Thanks everyone!
http://drupal.org/cvs?commit=340220