I noticed that no matter what day it is the all the days before the current day in the month for are greyed out so they appear to be in the previous month. The trick is to actually test this out you have to force your system time to change. Luckily I work with vagrant/virtual machine ;)

Here is the problem

Today's date is Nov 12 2015.

Here is the month calendar for today:
Only local images are allowed.
Notice how the 12th appears to be the first day in the month

Now if I force my system day to Nov 20 2015
Only local images are allowed.
Notice how the 20th appears to be the first day in the month

I am pretty sure the problem is in Drupal\calendar\Plugin\views\style\Calendar->calendarBuildMonth

I will work on the fix.

How to fake time on VirtualBox.
This method is not specific to using Vagrant

  1. With your virtual machine stopped run this command on host: VBoxManage setextradata VBoxInternal/Devices/VMMDev/0/Config/GetHostTimeDisabled 1
  2. start the virtual machine
  3. ssh into your virtual machine run: sudo date --set="Nov 20 02:57:27 EST 2015"

Once you are finished

  1. Shutdown your virtual machine
  2. on host run: VBoxManage setextradata VBoxInternal/Devices/VMMDev/0/Config/GetHostTimeDisabled 0

Comments

tedbow created an issue. See original summary.

tedbow’s picture

Ok it looks like this probably a know issue because date arguements

I found this comment in Drupal\calendar\Plugin\views\style\Calendar->render

// There are date arguments that have not been added by Date Views.
    // They will be missing the information we would need to render the field.
    // @todo uncomment this when we find a fix for the date range issue.
//    if (empty($argument->min_date)) {
//      return;
//    }
    $argument->min_date = new \DateTime('0 months');
    $argument->max_date = new \DateTime('+3 months');

This is what is setting minimum date for the range.

I will mark this as Postponed soon as it looks like it need date arguments to be fixed.

If anybody else knows that the date arguments have been fixed and this comment should actually removed let me know.

Oh well, at least learned out to fake system time on my virtual machine

tedbow’s picture

Status: Active » Postponed
Related issues: +#2613454: Port Date module functionality missing from 8.x core

Postponing this because it probably won't be an issue once this is resolved f #2613454: Port Date module functionality missing from 8.x core

Anonymous’s picture

The argument handler used, is one we specifically added for calendar since the date handlers in core are not sufficient and the date module doesn't provide us with one (yet). Some additional info can be found here: see #2567815: Add week, date, and year-month Views argument plugins.

If you can use the range to calculate min_date and max_date, it's available: $argument->options['calendar']['date_range']. But I'm not sure where they were set in the 7.x version.

Fwiw, we kept the argument handler to a bare minimum for now. As long as we don't know what will happen with the date module, it's quite possible that the handler will move out of the calendar module.

Edit: you postponed this while I was typing (had this open for a while :)), but I wanted to confirm your findings anyway

tedbow’s picture

Status: Postponed » Fixed

Fixed from other commits

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.