Page 1 of 1

v2.7: Week view shows wrong week

Posted: Fri Nov 28, 2014 9:23 pm
by sbradshaw
When switching from month view to week view, the first week in the month appears. I would expect it to show the current week instead (following the same logic as it showing the current month when you first load the calendar). I can't verify what the old version of the calendar did.

Re: v2.7: Week view shows wrong week

Posted: Fri Nov 28, 2014 11:35 pm
by russellhltn
sbradshaw wrote:When switching from month view to week view, the first week in the month appears.
That's not what I'm seeing. It defaults to the current week. If I go to month view and switch to months ahead, and then go to week view, it takes me to the same week in that month.

I thought there was something that kept track of the "current day" you were working on and week view followed that. But I seem to be unable to trigger that - at least not without creating/saving an event.

Re: v2.7: Week view shows wrong week

Posted: Sat Nov 29, 2014 6:18 am
by aebrown
I'm not sure what either of the previous posts mean by the term "current week", but I don't think either post accurately represents what the Calendar really does when switching between month and week views. Here are my observations:
  • The calendar doesn't really have a concept of "current week"; rather, it has a concept which I will call "target date".
  • The simple, consistent rule is this: when you switch to a different view, you will go to the week (for Week view) or month (for Month or Agenda view) that contains the target date.
  • When the calendar is initially loaded, the target date is set to today's date.
  • When you click on the Today button, the target date is set to today's date.
  • When you use the navigation calendar to go to a different date, clicking on a particular day will set the target date to the exact date you clicked on. When you use the navigation calendar from Month/Agenda view, you may think you're just clicking anywhere in the new desired month to move to that month, but that's not really true -- the exact day you click on is indeed remembered and will affect where you land when you later switch into Week view. Similarly, when you use the navigation calendar from Week view, you may think you're just clicking anywhere in the row of the new desired week to move to that week, but the exact day you click on is indeed remembered and will affect what happens when you move between Month/Agenda view and Week view.
  • When in Month view or Agenda view, moving to the next or previous month moves to the same day of the month in the new month.
  • One important exception to the above rule is that if you ever move through a month that does not contain the target day (for example, today's target date is 29 November, but I might advance through the months and get to February 2015, which only has 28 days), the target date is reset to the first day of the new month.
  • When in Week view, moving to the next or previous week does change the target date -- it is moved by 7 days forward or back.
  • Note that the above rule may make a dramatic change in the target date. For example, I might use the navigation calendar to go to 4 Nov 2014. Then from Week view, if I move to the previous week, my target date will be 28 October 2014 (7 days earlier).
  • Creating an event does not change the target date.
Once I got these rules down, I found that navigation choices the Calendar made when moving between Month/Agenda and Week views now made sense. There's no longer any mystery about where I land. Of course, the target date is never actually visible anywhere in the user interface, so its value can only be inferred by moving around and switching views.

Re: v2.7: Week view shows wrong week

Posted: Sat Nov 29, 2014 7:07 am
by aebrown
Here's an example of navigation which might have seemed quite mysterious before I understood the rules I listed in my previous post.
  1. Go into Week view.
  2. I want to see what's happening in the week of November 2-8, 2014, so I use the navigation calendar, choose November 2014, and click somewhere in the week of November 2-8. I happen to click on November 4 (behind the scenes that sets the target date to 4 Nov 2014).
  3. The week of 2-8 November 2014 is displayed.
  4. While in Week view, I'm curious what's happening on November 1, so I click the left arrow (in the top left corner of the calendar, just to the left of the "2 November - 8 November" display). (target date is moved back 7 days to 28 October 2014).
  5. I switch to Month view, and the month of October 2014 is displayed (target date is still 28 October 2014).
  6. I want to see what is happening in August 2014, so I click the left arrow two times to go back two months, and the month of August 2014 is displayed (target date is now 28 August 2014).
  7. I switch to week view. The week containing the target date is displayed: 24 August - 30 August.
Now repeat this sequence, but make an apparently insignificantly different choice in step 2. Note the different outcome.
  1. Go into Week view.
  2. I want to see what's happening in the week of November 2-8, 2014, so I use the navigation calendar, choose November 2014, and click somewhere in the week of November 2-8. I happen to click on November 8 (behind the scenes that sets the target date to 8 Nov 2014).
  3. The week of 2-8 November 2014 is displayed.
  4. While in Week view, I'm curious what's happening on November 1, so I click the left arrow (in the top left corner of the calendar, just to the left of the "2 November - 8 November" display). (target date is moved back 7 days to 1 November 2014).
  5. I switch to Month view, and the month of November 2014 is displayed (target date is still 1 November 2014).
  6. I want to see what is happening in August 2014, so I click the left arrow three times to go back three months, and the month of August 2014 is displayed (target date is now 1 August 2014).
  7. I switch to week view. The week containing the target date is displayed: 27 July - 2 August.
Although I made an arbitrarily different choice in step 2, different things happened in the sequence, which might appear to be inexplicable if you don't know what is happening behind the scenes:
  • In step 5, I landed in November instead of October.
  • Obviously, in step 6 I had to go back 3 months instead of 2 to get to August.
  • In step 7, I landed in a totally different week: 27Jul-2Aug, instead of 24Aug-30Aug.

Re: v2.7: Week view shows wrong week

Posted: Sat Nov 29, 2014 11:58 am
by russellhltn
Note that one significant difference between the current version and the prior version is the navigation calendar. The old version had it out there by default. In the new version, you have to click on the month (in month view) or date range (in week view) to call it up. Also, the navigation of the main calendar is fast enough the navigation calendar isn't as needed as it used to be.

This may create the situation where it appears the behavior has changed when in fact it's the user's behavior that's changed.