I'm excited to see this project on d.o and can't wait to see it released as a full project. This is a stub issue for notification when that happens. I hope to be able to contribute to the project as well for D7, since this is one of the most common requests I get from site administrators using my install profile. Who knows, maybe I'll even sign up to be co-maintainer. :)
| Comment | File | Size | Author |
|---|---|---|---|
| #11 | date_repeat_fm.zip | 7.27 KB | lias |
| #4 | formatter-hook-01.png | 45.08 KB | othermachines |
| #4 | formatter-hook-02.png | 65.26 KB | othermachines |
Comments
Comment #1
othermachines commentedThanks, @dnotes! Wanted to get a 7.x version underway to hopefully expedite path to full project. I'm happy to say I've just added a 7.x-1.x branch that is ready for testing.
Edit:
Link to branch: http://drupalcode.org/sandbox/othermachines/1456552.git/tree/refs/heads/...
Comment #2
chiebert commentedHey - Just found this today, and it's working nicely for me on D7 with Date 7.x-2.6. I haven't done anything with customising the theming of the repeat format, but it's nice that you've put those pieces in place. This really helped me out in response to #1401688: How do I make the node view of a repeating date event only show the specific date of the instance I'm viewing..
Comment #3
othermachines commentedI confess I keep putting that off, thinking that the folks over at Date module will be fixing this Any. Moment. Now. But since it's been 2-3 years since I first wrote my own fix, I guess I should look at putting it out there.
Spurred on by @chiebert's post, I spent a bit of time assessing the state of the module late last week. It needs work. More like an overhaul. It does way too much unnecessary heavy lifting, which makes it vulnerable to even the smallest code changes in Date API and Date Repeat API.
I've already started on a new version that doesn't create a new formatter but hooks into existing formatters, and only when repeating dates are at play. The purpose of this is to allow Date API and Date Repeat API to take care of the bulk of the output processing, leaving this module to do only one thing -- prettify the repeat output.
I'll likely be renaming the module in order to conform to other modules that hook into formatters. Kind of a pain, I know, but I foresee that someone will bring that up during the release review. That'll mean opening up a separate sandbox.
I'll hopefully have a first version up by the end of the week. I'll keep everyone posted on this thread.
Cheers and thanks for your input -
Comment #4
othermachines commentedA couple of screenshots showing how the new formatter settings would look. There is no longer a separate formatter; instead we hook into any formatters of type 'date_default' where the field is a repeating date field. "Expanded" and "Condensed" become "Full" and "Teaser".
Comment #5
chiebert commentedLooks good - I agree it's best to use native date.module functions/methods where possible. As long as this remains a good solution for #1401688: How do I make the node view of a repeating date event only show the specific date of the instance I'm viewing., which has been a royal PITA: if there's only one date, show it; otherwise, show the logical one (last one if all dates have passed, or next one if there are still more to come...).
Comment #6
othermachines commented@chiebert Agreed 100%. I'd like the output to remain pretty much the same, just maybe simplify the theme functions a bit.
Comment #7
aquaseal commentedafter hours and hours of trial and error and searching around I came across your code. It sounds like a dream come true and I cannot wait to try it out! This will help the date module immensly as I am sure there are plenty of unspoken people out there scratching their heads (or giving up) on displaying the closest date to now in a repeating date. Looknig forward to this module, thanks!!!
Comment #8
othermachines commentedThanks, @aquaseal. I hope it works out for you. Come back and let us know what you think.
Comment #9
aquaseal commentedi used this module tonight and everything just worked as expected out of the box! great job @othermachines. One feature request that may be beneficial would be to show the "edit" and "delete" links when using the the date repeat instance module:
http://drupal.org/project/date_repeat_instance
i will implement a work around for a single block that will simply print the date formatted field using the Date and time format to get the links back for easier management.
Comment #10
othermachines commentedThanks for the feedback, @aquaseal. Would you mind opening a separate issue for the feature request? I'll have a look as soon as I'm finished revamping the current code.
Comment #11
lias commentedThank you chiebert for pointing me in this direction and thank you to othermachines for providing this much needed module! I have installed it on a development site using Drupal 7.22, Calendar 7x-3.4, Date 7x-2.6+2-dev and I am so thrilled with the output. I have used the expanded format to display the repeating date and it worked just as you stated in the read me.
I will be installing it shortly on a production machine since I seriously need this function, and it's hard to believe that it's a feature request at the Date module. I'm attaching the zipped of version of your module for those who might have problems with the sandbox download.
Thanks and I will be back!
Comment #12
othermachines commentedThanks a lot, @Isabug.
Update: still working on that revamp talked about in #3. Been very busy. I could use a few more hours in each day. :/
Comment #13
Mark Nielsen commentedothermachines, you're a superstar.
On one hand, it does seem odd this isn't provided out-of-the-box with the main Date module. It doesn't seem like a particularly unusual use-case. But given that Date does have this deficiency, I'm so grateful you've done all this work. You've helped me out massively on the project I'm working on, and I think this makes Date Repeat actually fit for purpose.
Thank you :)
Comment #14
othermachines commentedThanks, Mark! Glad I could help.
Comment #15
squarecandy commentedYes, #1509984: Release as full project looks like there's a working solution, and #3 and #4 look promising.
For now, I decided to do it at the theme level:
Comment #16
bkosborneAren't there issues with caching that aren't considered here? If you're hiding past dates based on the current date from PHP, it will only work if the page cache entry for that node is cleared very often.
Comment #17
othermachines commentedThanks for the note @bkosborne. It's my understanding that the output of hook_field_formatter_view() (which is used here) is outside of the scope of the page cache. If caching is desired, a cache_get/set would be required. I'm not 100% certain - it's been a little while since I've looked at this code - so feel free to correct me if I'm wrong.
Comment #18
othermachines commentedDecided a theme-based approach to the repeating dates problem is still needed, but this module is overkill. I've created a new sandbox over here: Date Repeat Themeable. Its primary purpose is to make repeating dates more themeable with minimal interference with Date module's usual processing. Your participation and feedback is welcome!