Closed (fixed)
Project:
Timeago
Version:
7.x-2.x-dev
Component:
Documentation
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
19 Jan 2012 at 00:16 UTC
Updated:
29 Jul 2012 at 09:01 UTC
Jump to comment: Most recent file
Comments
Comment #1
icecreamyou commentedAre you talking about custom date formats at
admin/settings/date-time? I'm not sure where the Date module comes into play here.I don't want to support any solutions that require patches to core, and also 'c' isn't supported until PHP5, so
'Y-m-d\TH:i:s+00:00'is the best we can do for D6. We can actually 1-up this for Drupal 7 by implementing hook_date_formats() to provide a new Timeago date format by default.Where do you think this should be documented? Presumably in README.txt?
Comment #2
john.money commentedWell, hell's bells. You're right... Date API takes over the Date and Time add new format. On a clean install, the custom format works as expected. So Date API is not required.
And your suggestion to use:
Y-m-d\TH:i:s+00:00instead of 'c' worked for me. I made the server timezone adjustment which I suppose will be hardcoded for every user anyways (no configurable timezones). Mine now looks like:
<\s\p\a\n \c\l\a\s\s="\t\i\m\e\a\g\o" \t\i\t\l\e="Y-m-d\TH:i:s-05:00">F j, Y - G:i</\s\p\a\n>Doc in README would be swell. Thanks!
Comment #3
icecreamyou commentedAh, you're right, timezones will be inconsistent since that gets run through format_date() instead of gmdate(). I think
Y-m-d\TH:i:sOshould work instead of manually specifying the time zone (because if you hardcode it, the time will be wrong for everyone outside of your server's time zone).Anyway, I've attached a patch for D7 that adds new date formats for Timeago. However, if you just manually add a Timeago format in D6 or D7, it won't work because the Timeago JS won't get added to the page. To get around that, the patch adds the Timeago JS on every page. I can't decide if this is acceptable or not. Possibly there should be an option.
Comment #4
icecreamyou commentedRenaming for clarity.
Reviews appreciated...
Comment #5
ezra-g commentedThis patch appears to be malformed:
Comment #6
icecreamyou commentedCommitted fix to dev.
Requires clearing caches after upgrading before usage.
Comment #7.0
(not verified) commentedfix link