Closed (outdated)
Project:
Event
Version:
6.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
11 Aug 2006 at 22:51 UTC
Updated:
13 Apr 2018 at 20:57 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
gtcaz commentedI vote for this as well. I hacked the PHP to display things differently, but then blew it away when I rsynced with the current 4.7 cvs branch. I'd rather not have to maintain this by hand. I better option would be to add a configuration option in the events setting page.
Comment #2
gtcaz commentedHere's an example of how I changed the display format. If I upgrade I have to re-edit the file. It'd be nice to have a control panel option.
File: event.theme
Comment #3
gtcaz commentedActually, should probably move that outside the
ifstatement.Comment #4
gtcaz commentedSorry to keep following-up my own posts, but I thought I'd add that I with the above hack I need to add a manual timezone offset on my production server, while my XAMPP test install doesn't need this.
Comment #5
solipsist commentedExcellent! Thanks for sharing. We have by now already made the necessary modifications.
Any chance the module maintainer or someone can produce a patch that also includes the configuration option to choose between the two display formats, which can eventually by committed to CVS?
Comment #6
solipsist commentedThis is our code, and it takes the user's time zone into consideration, 24 hr format below:
Comment #7
gtcaz commentedNo one is interested in this change? I think showing the date of an event should be preferred to "(54 days)". Also, showing "(event)" is just plain ugly.
Comment #8
fraew commentedi'm a big fan of this - actually grouping events in the block by the day would be even better...
Comment #9
billl4 commentedThanks for this. I'm a newbie, so this really helped me out. I couldn't stand the way (13 hours)(event) looked. I changed it to a slightly different format to include Day, Month & Date & start time (on Wed Mar 7 @ 8:30am). I think I did it correctly
$output .= '<span class="event-timeleft">on '. format_date($node->event_start, 'custom', 'D M j @ G:ia') .'</span>';Cheers,
Bill
Comment #10
gtaylor commentedBig agreement. I would like to see the start date and do NOT want to see the content type (event).
I also found this post on the site today: http://drupal.org/node/118413 so I know quite a few want it. Making this change will also allow cache to remain valid longer. I can't imagine why somebody would NOT want this enhancement. recommend a simple change - losing old behavior altogether.
Anecdote for Enhancement Need
I built a website for my dad and all he could do in the acceptance meeting was complain about the #days. He said his customers would be confused thinking that the conference was 10 days long vs. taking place in 10 days. I'm sure he's right for at least some users. It took me 10 mins. to get off this subject before he would see all the other cool things Drupal and Events did for him.
I plan to upgrade my dad's website to 5.1 sometime within the next month or two, so I hope this enhancement makes it to 4.7x & 5.1x
(Despite what dad says :-) awesome module! Thnx for supporting it.
Comment #11
cookiesunshinex commentedThanks for this information. It helped quite significantly. I chose to use a better International Date format Day, Number Month @ Time: EX: Fri, 30 March @ 11:00PM, but I also wanted to include the number of days left to be more clear.
I used this code:
How would I change it so that the date is formatted on the left hand column, the event title is listed (on the same line), and then (number of days left) is formatted on the far right.
Currently, it's title of event on the left, then on the next line/right colum date, then next line right column number of days left.
Thanks.
Comment #12
mattjabs commentedI am in full support of this addition to the module. I run a corporate website & the president doesn't like the "days countdown" either. He would much prefer a date & maybe a time as well. This should be an option.
I have tried all the code here on this page & although it does format it differently on my page, it does not bring the correct dates onto the block. Instead of my actual event date showing up, all my events list the same date (on Wed Dec 31 @ 20:33pm). Every event in the Upcoming events block lists that date, no matter what the actual date is.
Module maintainer, I love this module, and thank you for your hard work. Please add this feature, it would be SOOO much appreciated.
I do know that using the Event Views module, you can create a custom block, but the Views module still has my head swimming so I don't understand how to do this yet.
Please help. Let it be noted that I'm using Drupal 5.1 and Event.module version 5.x-2.x-dev
Matthew Jabs
Comment #13
fm commentedI agree. This feature should be added into an official release. Most people use dates, not countdowns, to schedule their activities.
Comment #14
mattjabs commentedIs there any update on this feature, I will kiss you if there is! ;-)
For everyone out there waiting for the developers to update this module (you devs are "da bomb"), what I'm doing in the meantime, that has proved to be a viable "work around" is to put the date of the event in the title.
Ex. Here's the title I use:
Comment #15
killes@www.drop.org commentedthis can be easily done through theming.
Comment #16
solipsist commentedYes it can but apparently it's too complicated for many users who do not need or want to learn theming. The theming solution has been available for over a year but people are still requesting a proper feature. The response here is evidence enough that this is something a lot of people want and need.
If you don't want to spend the time to do it, I can submit a patch. Ok with that?
Comment #17
killes@www.drop.org commentedOh, well, if this is really so often needed, I won't say no to a patch against event 5.2
Comment #18
solipsist commentedAwesome! :)
Comment #19
Jim Ruby commentedHi, I hope this is the right place to post and ask for help, but I am using the views module and I want to get a block to show something like:
event title
start date and time - end date and time
number of days till event
I've been working with the views module to ad least get the first two lines displayed, but I've having no luck at all and about ready to give up.
Any help out there? Sorry if I am asking in the wrong spot, but it looked like there was talk about this so just replied to the thred.
Thank you
Comment #20
aezalpha commentedmattjabs - I updated the event.theme file to include the date & time in the title of the upcoming event. This may help in not having to manually put those into the title for recurring events.
function theme_event_upcoming_item($node) {
$event_start_date = format_date($node->event_start, 'custom', ' - m/d (g:ia)');
$output = l("$node->title $event_start_date", "node/$node->nid", array('title' => $node->title));
if ((count(event_get_types('all')) + count(event_get_types('solo'))) > 1) {
$output .= ''. t("($node->typename)") .'';
}
return $output;
}
Comment #21
fm commentedHas this patch been added to the Event 5.2 release? Or are we required to patch it ourselves?
Comment #22
solipsist commentedUnfortunately I haven't had the time to do it yet. If someone else wants to, be my guest. It would just be nice to get it done, help out some people who aren't that theming-savvy.
Comment #23
mnoyes commentedWork around?
I created a new view titled "upcoming events" with fields for "title" and "start time."
Added filters for "node: published" (yes), "node:type" (event), and "event: start date" (greater than or equals to now).
Doesn't solve the problem, which should be as simple as a checkbox on the events administration page, but any reason not to use this?
Comment #24
jmcclelland commentedI took the following steps to implement this idea. I didn't touch any of the event module code or files. I was using the chameleon theme that shipped with Drupal 5.
This function will display the date in the appropriate format given the format chosen in Settings / Dates and Times.
Comment #25
agerson commentedIs there a drupal 6 version of this?
Comment #26
shashi_lo commentedHere is the code for Drupal 6
Comment #27
Morn commentedAnother Code example for Drupal 6 - Countdown and date - Table like - German only (am instead of "at the")
Comment #28
dattas commentedI need patch code for event to be convarted into marathi.
Comment #29
gtaylor commentedBump. Is this enhancement going into 6?
Any idea when 6 will be production ready? I love this module and we really need it for a new site planning to go live in late Oct / early Nov.
Comment #30
dcoffee commentedThanks everyone for your help on this. I definitely would love a control panel option.
Comment #31
JirkaRybka commented+1 for the feature. I'm another one thinking, that the countdown display makes no sense in some cases (if not all cases), and that opinion was also supported by users' reactions on my site in the old days, when I ran event module in its original form. I also think, that this is a content-of-the block issue, not theming.
I'm still on 5.x, so I've no idea how this looks on 6.x, but I'm maintaining my own hack (for years now), and I posted another issue a while back: #177624: Upcoming block: Plain date/time option - so most probably either that or this is duplicate, but the linked issue have a patch. I see that someone even RTBC'ed that patch, but that all happened a year (!) ago, and I have no time to go through it again today, to ensure it's up-to-date. It would be great, if someone else took over that.
Code-wise, I was long using a hack very similar to the snippets earlier in this thread here (also seen in my initial patch in the other issue), but later I discovered serious problems with the time being one-hour-off after timezone-changes (emulating Daylight Saving Time), revealing that simple approach being incompatible with the various timezone-options available. The latest patch (on the other issue) uses a code, that is more-or-less verbatim from the full-node-view, ensuring the same times being shown everywhere for a given event.
By the way - I also tried to build an Event block through Views (a category-restricted block for a specific page), early in the 5.x era of my website, but after users' complaints I had to remove it completely, because the Views output for events date/time suffered from the same problem (being not timezone-stuff aware, and therefore one-hour-off after switching Daylight Saving Time). That turned out to be - more or less - unsolvable for me (due to Views bypassing the event module's time-formatting code, as far as I remember), so unless something changed in the last year or so, I don't consider Views an usable replacement for the Upcoming events block.
Really, another great feature would be a "fixed time" for events, showing just plainly what the node author entered, with no timezone-translations whatsoever. My site's audience is all local, so the whole timezones' stuff is just trouble here.
Comment #32
JirkaRybka commentedOK, I took another look into the 6.x-2.x-dev version.
Although I don't really feel like this belongs into theming layer, I can still accept this approach (since I see it's, like, preferred here), but then I think the following concerns should be addressed:
- Theming of the item must be a template. A themable function is far too complicated for a lot of users "just wanting to switch from countdown to something more friendly". Template is better (although it's still a nightmare, if compared to a setting on administrative pages). (TODO: If going in this direction, consider providing an alternative template with start date/time already implemented, to be enabled by just renaming files.)
- The appropriate variables must be available. As of previous hints to use themability, the existing 'event_start' property (taken directly from DB) is insufficient, because it: 1) Is NOT formatted along site settings of date/time format, and, 2) Is NOT adjusted for timezones, per event-view settings.
I've created a new patch for 6.x-2.x-dev, doing the following:
- Turning the 'event_upcoming_item' theme function into a template event-upcoming-item.tpl.php
- Providing all the variables as in event_nodeapi.tpl.php (partially by re-using its preprocess function), including all sorts of formatted/unformatted start/end dates/times
- Providing also variables needed/useful in the default implementation, i.e. $node_title, $node_link, $timeleft, and $node_types (for the already-existing check only).
Just like in my previous 5.x patch, there's a bit of new code inside _event_block_upcoming() to obtain correct (timezone-settings aware) start/end dates/times. This is basically taken from event_nodeapi() case 'load' and 'view' (because I don't think it's a good idea to do a full node_load() here, but still we need to re-use some of its functionality). The code in 'view' (formatting the various variables for theme layer) is now abstracted to a separate function _event_prepare_start_end($node), without any changes, to avoid code duplication. From the code in 'load', only the needed part is reproduced. (It might be possible to merge it into the original query somehow, but these huge DB-type specific queries are quite scary, so I gave up on that. With block caching in core, I don't think 6 queries are too big deal.)
Testing this is also affected by #260355: Timezone handling settings not saved, you might need to write variables in database by hand, to change the event-viewing timezone settings.
Comment #33
JirkaRybka commentedRelated issue, with a bit different patch: #34271: Display date of event rather than days until event
Comment #34
Dubber Dan commentedHave used the code in comment 24 which is a great improvement, but how do I further edit this so that only the date is shown and not the start time too?
I'd also like to add my voice to requesting this to be a switch within the Event module admin section. Would make sense to simply be able to decide what to display in the block, seeing as the block is provided by the module
Comment #35
japerryEvent for Drupal 8 is unrelated to older versions. If an issue similar to this one exists, please open a new issue with the 8.x branch.