Unless I glazed over this mentioned elsewhere, a link to send me in the right direction would be great!

I have a website that schedules events during different times of the day. I am using the great date browser as an attachment to a view with an argument set to "day" to provide a day by day schedule.

This works great except for two things I would like to do:

  1. On today's date, I would like the date browser to start on the current time relative to the user - so there would be no option to search yesterdays schedule, but you could page forward.
    What I tried and what did not work:
    I tried filtering my view by setting the date to >= 'now', and the date browser broke and views queried all results (which resulted in the script timing out) :(
  2. I would like the date browser to consider a day as beginning at 6am and running until 5:59am the following night?

For 1. + 2. I think what I'm looking for is some argument handling code to customize the queries concept of 'day' but I didn't find much documentation on this particular use case.

Some suggestions or help would be hugely appreciated.
Thanks

CommentFileSizeAuthor
#3 schedule-view.txt10.22 KBfallsemo

Comments

karens’s picture

Status: Active » Fixed

I just committed a fix that will work if you're using PHP 5.2+. You can change the operator to 'between' then put something like '6AM today' in the first default and '5:59AM tomorrow' in the second one. You'll need today's commits, so wait for tomorrow's tarball.

If you're using an older version of PHP, less than PHP 5.2, there is no good way to do this.

fallsemo’s picture

KarenS!

What a nice update to see! Thank you so much for committing changes for this feature.

I will wait for tomorrows tarball.

fallsemo’s picture

Version: 6.x-2.2 » 6.x-2.x-dev
Status: Fixed » Needs review
StatusFileSize
new10.22 KB

I believe this does not fix this issue when combined with Date Browser.
I assume the problem is that date browser can only inherit Exposed Filters as an option (as opposed to non-exposed filters) among requiring mandatory arguments.

To confirm, I am using PHP Version 5.2.9-0.dotdeb.2.

See attachment for result.

karens’s picture

Status: Needs review » Active

This is improperly marked as a patch. There is no patch here.

arlinsandbulte’s picture

Priority: Critical » Normal
westis’s picture

Hi,

I added a filter with "BETWEEN today 4am and tomorrow 4am". But when I click to another date in the date browser I always get today's events (according to the filter) AND the events of the day I've clicked to. That is, the filter doesn't seem to work with the Date Browser. Or did I do something wrong?

As the first poster, I also want the day to be between 4am to 4am the following day, so that events of the first four hours after midnight actually belongs to the previous day.

Cheers,
Daniel

andrew smith’s picture

I have the same problem: Date Browser (after clicking Previous or Next) shows BOTH the initial dates AND the dates clicked to. Did you find a solution westis?

I'm trying to set up a Sundays only View for a church website - clone of 'calendar' view but using Grid.
The initial view shows This Sunday fine; but when I add a Date Browser to move back and forwards by week to view Next/Previous Sundays: the View retains This Sunday as well as showing Next/Previous when clicked. I have tried seemingly everything.

andrew smith’s picture

Worked it out. For anyone else with the same hassle:

Date Browser - 'Filters' bringing in 'Date: Date (node)' with 'Date default' entered as 'sunday' because we just want sundays. Lovely.

This Date Browser is 'attached' to relevant Page View of Sundays. Terrific.

But the Page View had the same Filters setting as the Date Browser - i.e. with 'Date default' as 'sunday'. After going round the houses many times, I simply deleted 'sunday', leaving the field blank. And then it worked. Don't know or care why - it just does.

....
some further info for noobs like myself:
Using some Global PHP - print date('Y') . "-W" . date('W'); - can produce a nice URL like: 'sundaypage/2011-W31' - to link to - and for your fairly default Views Argument to use.

damienmckenna’s picture

Issue summary: View changes
Status: Active » Closed (outdated)

We're sorry but the D6 release of Date module is no longer being supported. You are encouraged to update to Drupal 7 or 8, or direct questions to Drupal Answers.