I have finished a full implementation of Calendar for a large organization with many calendars, and I'm very happy with it, except for one thing, and it's a show-stopper... No date/day numbers show up in week view! That's a serious problem because we find that most people in large organizations use week view so that they can see more detail. Everyone's complaining that they can't use this calendar system because there are no dates on week view. Seems like such an easy thing to do, compared to all of the other impressive complexity in the Calendar project. Am I overlooking something? Please help!!!
Comment | File | Size | Author |
---|---|---|---|
#34 | calendar-week-overlap--calendar.tpl_.php_.txt | 9.48 KB | Gaurav.Singh |
#18 | calendar-weekview-numbers-1593626-18.patch | 2.34 KB | highfellow |
#16 | calendar-weekview-dates2-1593626-14.patch | 2.34 KB | highfellow |
#14 | calendar-weekview-dates-1593626-14.patch | 2.52 KB | highfellow |
#8 | weekview-dates-dateurl-integer.patch | 527 bytes | _vl_ |
Comments
Comment #1
federiko_ CreditAttribution: federiko_ commentedI'd really enjoy this feature too !!
Comment #2
MrSasquatch CreditAttribution: MrSasquatch commentedI just changed priority to major because there has been no response so far, and I really think that this is a major shortcoming of the calendar. It's hard to get stakeholders to buy in to Drupal as a replacement for our existing public calendars because everyone uses week view and they don't want to not have dates appear above each day in week view. Any assistance with this issue would be greatly appreciated. Thank you so much!
Comment #3
wusel CreditAttribution: wusel commentedI agree to the new priority.
Comment #4
TheEdonian CreditAttribution: TheEdonian commentedI created a small patch that checks the url and adds the date to the weekview.
The calendar need to be in the root path for this to work. (I think)
Would love some feedback.
Comment #5
wusel CreditAttribution: wusel commentedIn my test, your patch also added the day-dates on the top of the months-view.
That is not good.
Wusel
Comment #6
waltercat CreditAttribution: waltercat commentedSubscribing, this seems like a basic element that should be part of such a complex and highly used module. How do people use this if they can't see the date in the week view?
Comment #7
ExTexan CreditAttribution: ExTexan commentedPlus 1. I'm also very surprised this feature is missing.
Comment #8
_vl_ CreditAttribution: _vl_ commentedI used the patch #4 and apply this patch to have a correct display in my case.
Comment #9
MrSasquatch CreditAttribution: MrSasquatch commentedAny chance that patch will become part of the official release?
Comment #10
wusel CreditAttribution: wusel commented@TheSasquatch:
If you want to get this in the official release:
Set status (https://drupal.org/node/156119) of this issue to 'Needs Work' or 'Reviewed & Tested by the Community'.
Wusel
Comment #11
johnheaven CreditAttribution: johnheaven commentedI just tried your patch in simplytest.me, but got the error "An error occured while patching the project."
Would be great to get this issue sorted.
Comment #12
bszk CreditAttribution: bszk commentedHi,
I implement this by modifying calendar.module and it seems to work.
The idea is to fix $translated_days if the view is for a week.
First I get the node_date_argument and use that to change the array $translated_days.
1) I didn't know how to get that argument out of the $view object so I parsed for it. I would like to know how to do that properly.
2) I decide if it is a week view if that arg has "00:00:00" in it.
Ultimately it would be nice to have this capability in the calendar module without having to hack at it.
Bill
My code in calendar.module:
Comment #13
romansta CreditAttribution: romansta commentedI patched calendar.module with #4 and #8.
But I also had to change the number of the pathargument in line 363, because I changed the default Url:
Comment #14
highfellow CreditAttribution: highfellow commentedI've written a new patch, based on the previous ones, that seems to work better:
- getting the week number from $view->args[0] works more reliably than using the path.
- it automagically detects whether it is a week view from the path, and only shows the week numbers when appropriate.
- I chose to use single day numbers rather than d/m/y.
- it should work even if you've put your views in a sub-path such as '/view/events/week'
It won't work if you use anything other than '/week' for the week display. I've only tested it with weeks starting on monday.
Comment #15
highfellow CreditAttribution: highfellow commentedI've just re-done the patch so that it uses the calendar display type from the view, not from the path. It should now work whatever path you have set for your week view. (E.g. if you're using non-english path names). I haven't looked at weeks starting sunday. If you set 'use ISO-8601 week numbers' under 'Configuration » Regional and language', you should be safe.
Comment #16
highfellow CreditAttribution: highfellow commentedSorry, forgot to attach the file.
Comment #17
sassafrass CreditAttribution: sassafrass commentedI tried the patch in #16 using
and got the following errors:
Comment #18
highfellow CreditAttribution: highfellow commentedI've just uploaded another patch, which is done against the latest 3.x-dev version, and also fixes a small mistake in the previous one. https://drupal.org/files/issues/calendar-weekview-numbers-1593626-18.patch
Comment #19
sassafrass CreditAttribution: sassafrass commentedI tried the patch in #18 against latest 3.x-dev version using:
and got the following errors:
:(
Comment #20
highfellow CreditAttribution: highfellow commentedWhen I do it, it works OK:
If I check the file after doing this, the patch has been applied. It also works OK with:
Comment #21
lukasss CreditAttribution: lukasss commentedworks great number 18, I have added format_date:
Comment #22
sassafrass CreditAttribution: sassafrass commentedThank-you Highfellow. I applied the patch using the steps you outlined in #20 and got the same results as you did. Not sure why it didn't work before. I did not originally clone the Calendar project. I had just downloaded it from the project page. I also had not used wget to download the patch. I suspect it was the latter that did the trick. Thanks again.
Comment #23
masterperoo CreditAttribution: masterperoo commentedThere is an error in patch #18
when no argument is passed, default for today - 13/02... is week 7 (not 07):
first day
$dateurl = explode('-W', $view->args[0]);
returns $dateurl[1] as 7
date derivation further down works only if 07 is passed
obviously this will work after week 9 each year - say in 2 weeks.
Comment #24
nerdoc CreditAttribution: nerdoc commentedpatch #18 does apply, but creates an error when viewing the month view of the calendar. In this view the $view->style_options array does not get a 'calendar_type' key, just add a
dprint_r($view->style_options)
before the$period = $view->style_options['calendar_type'];
. It looks like this in month view:So this assignment to $period can not not work. I would change the line to:
Then everything works as expected. Could that be a bug in the calendar module? Why is calendar_type not assigned in any case?
Comment #25
jadgsam CreditAttribution: jadgsam commentedThanks for this patch it is very appreciated by the final users.
One question to highfellow, is there a way to make it work but with weeks starting on Sunday?
Comment #26
izmeez CreditAttribution: izmeez commentedThanks, but no cigar:-(
The patch in #18 applies to 7.x-3.5 without any errors but it needs work.
As stated in #25 it does not work correctly with weeks beginning on Sunday.
And fails with url's that use a single digit week e.g. 2014-W1 to W9 inclusive.
Comment #27
tim-dielsThis also doesn't work when using AJAX pagers. For the rest it seems to be working correctly to me.
Comment #28
PhilY#18 works fine with Calendar 7.x-3.5, thank you.
Any news about single digit week numbers?
Comment #29
hcethatsme CreditAttribution: hcethatsme as a volunteer commentedHey folks,
There is no need to patch the module. You can override calendar-week.tpl.php (and/or calendar-week-overlap.tpl.php) in your own theme, and use a value from $view->date_info to grab the exact date (avoiding zero padding issues etc.) Here's an example:
to something like this (formatting not ideal, sorry):
Hope this helps! I spent some time looking at the patch before realizing it wasn't necessary at all. BTW, for the single-digit months, the solution would be str_pad($dateurl[1], 2, '0', STR_PAD_LEFT).
Comment #30
lucyconnuk CreditAttribution: lucyconnuk as a volunteer commentedHaving the same problem and trying to apply hcethatsme's method, but I just can't seem to get the view to pick up my copy of calendar-week.tpl.php. I have tried clearing all caches, clearing Views cache, changing theme and changing it back, etc. Am I being stupid? Do I need to put something in template.php?
Comment #31
lucyconnuk CreditAttribution: lucyconnuk as a volunteer commentedAh, solved my own stupidity. For anyone else having the same problem:
There are 2 template files: calendar-week.tpl.php and calendar-week-overlap.tpl.php. Which one is used depends on what you select in the view.
If you look at your Week display and go to Format: Calendar | Settings, you find a setting called Multi-day style.
If you select "Display multi-day item as a single column", Calendar uses calendar-week.tpl.php.
If you select "Display multi-day item as a multiple column row", Calendar uses calendar-week-overlap.tpl.php.
Unfortunately I still have the problem of my Sunday events not appearing. I am still looking into this.
Comment #32
andres_de CreditAttribution: andres_de commentedHi lucyconnuk,
the sunday dates in week view disappear when you use calendar 7.x-3.5 and Date 7.x-2.9
I rolled back to Date 2.8 and the sunday dates came back.
I didn't find an other solution...
(edit) Rollback "solution" reported here: http://drupal.stackexchange.com/questions/168049/calendar-prev-next-butt...
Comment #33
cmbehr CreditAttribution: cmbehr commented#29 works great, except for Daylight Savings Time! One day a year has 25 hours. Instead of
use
Comment #34
Gaurav.Singh CreditAttribution: Gaurav.Singh as a volunteer and commentedHi,
I achieved to show date with day by overriding view template
---- calendar-week-overlap--calendar.tpl.php
I have added these lines to get current date and added it on following template
print $cell['header_id'];
">Find the attachment for working template
Comment #35
wcweb CreditAttribution: wcweb commentedThank you gaurav.singh #34 works great!
Comment #36
fakir22 CreditAttribution: fakir22 commentedThanks cmbehr, #33 is the real and elegant solution !
Comment #37
apaderno