Title: Wrong dates and days combinations.
Last modified: August 22, 2016

---

# Wrong dates and days combinations.

 *  [sempervivat](https://wordpress.org/support/users/sempervivat/)
 * (@sempervivat)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/wrong-dates-and-days-combinations/)
 * First: I love this plugin!
 * I have this really weird error going on in both February and
    November, December,
   January, they all look great. January 31 2015 is on a Saturday [(see here)](http://i.imgur.com/khPAUF1.png?1).
   February 1 2015 should start on a Sunday, yet in this calendar it doesn’t. It’s
   displayed as starting on Monday instead.[(see here)](http://i.imgur.com/WpVxQF6.png)
 * This of course causes all my events to be displayed wrong.
    Even more weird: 
   it stays wrong up until April 1 2015. Then it’s all fine until November 1 2015
   which should start on a Sunday (again). Yet, it is displayed as starting on Monday.
 * Seems like it has something to do with those Sundays. 🙂
 * Would greatly appreciate a fix as it’s kind of useless like this right now.
 * [https://wordpress.org/plugins/event-list-calendar/](https://wordpress.org/plugins/event-list-calendar/)

Viewing 8 replies - 1 through 8 (of 8 total)

 *  Thread Starter [sempervivat](https://wordpress.org/support/users/sempervivat/)
 * (@sempervivat)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/wrong-dates-and-days-combinations/#post-5478328)
 * Thinking about it, it’s probably an Off-by-one error.
 *  Plugin Author [ryanfait](https://wordpress.org/support/users/ryanfait/)
 * (@ryanfait)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/wrong-dates-and-days-combinations/#post-5478349)
 * Hm, looks like an issue when the start day is Monday and not Sunday. I’ll take
   a look at this as soon as I have the time and release an update soon.
 *  Thread Starter [sempervivat](https://wordpress.org/support/users/sempervivat/)
 * (@sempervivat)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/wrong-dates-and-days-combinations/#post-5478474)
 * Thanks so much! I would really appreciate that!
 *  [dmitryno](https://wordpress.org/support/users/dmitryno/)
 * (@dmitryno)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/wrong-dates-and-days-combinations/#post-5478520)
 * Could not wait for ryan to fix this since this was really important.
    got to 
   fix it myself. edit plugin php file, find the following lines:
 *     ```
       if(get_settings('start_of_week') != 1) {
       		for($i = 0; $i < $strt_day; $i++) {
       			$cal_output .= "
       						<td class=\"event-list-cal-blank\"> </td>\r";
       			$k++;
       		}
       	} else {
       		for($i = 1; $i < $strt_day; $i++) {
       			$cal_output .= "
       						<td class=\"event-list-cal-blank\"> </td>\r";
       			$k++;
       		}
       	}
       ```
   
 * Occurs three times in the code. In each place, put this instruction before the
   for loop in the else clause:
 *     ```
       if ($strt_day < 1)
              $strt_day = 7;
       ```
   
 * Worked for me, hope helps someone else. Ryan, please review and fix this.
 *  [bdvllrd](https://wordpress.org/support/users/bdvllrd/)
 * (@bdvllrd)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/wrong-dates-and-days-combinations/#post-5478536)
 * Thanks for this fix. I confirm that this instruction have fixed the issue for
   me too.
 * I added the instruction if ($strt_day < 1) $strt_day = 7;
    four times (not three
   times) in the code of the 1.7 release.
 * before the line 307
    before the line 586 before the line 1560 before the line
   1836
 *  [bdvllrd](https://wordpress.org/support/users/bdvllrd/)
 * (@bdvllrd)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/wrong-dates-and-days-combinations/#post-5478537)
 * A more simple fix to solve this problem has been provided by visor69 :
 * To solve this problem you need to replace the line
    $strt_day = date (‘w’, mktime(
   0, 0, 0, $ month, 1, $ year)); to $strt_day = date (‘N’, mktime (0, 0, 0, $ month,
   1, $ year));
 * See [https://wordpress.org/support/topic/incorrect-display-of-the-days-on-the-calendar](https://wordpress.org/support/topic/incorrect-display-of-the-days-on-the-calendar)
 * Replaced in four places.
 *  [LoraK8](https://wordpress.org/support/users/lorak8/)
 * (@lorak8)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/wrong-dates-and-days-combinations/#post-5478539)
 * Instead of the suggestions above, I found if I started the week with Sunday, 
   the issue was resolved.
 * Starts the week on Monday:
    `if(get_settings('start_of_week') != 1) {`
 * Start the week on Sunday:
    `if(get_settings('start_of_week') != 7) {`
 * Found 8 times: lines 279, 300, 557, 579, 1531, 1552, 1808, and 1829
 * [http://kctcspresident.com/](http://kctcspresident.com/)
 *  [VeeLow](https://wordpress.org/support/users/veelow/)
 * (@veelow)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/wrong-dates-and-days-combinations/#post-5478542)
 * well, you can just “start the week on Sunday” by changing that in the main WordPress
   settings.
 * bdvllrd’s post above indeed provides an effective and easy fix!

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘Wrong dates and days combinations.’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/event-list-calendar.svg)
 * [Event List Calendar](https://wordpress.org/plugins/event-list-calendar/)
 * [Support Threads](https://wordpress.org/support/plugin/event-list-calendar/)
 * [Active Topics](https://wordpress.org/support/plugin/event-list-calendar/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/event-list-calendar/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/event-list-calendar/reviews/)

 * 8 replies
 * 6 participants
 * Last reply from: [VeeLow](https://wordpress.org/support/users/veelow/)
 * Last activity: [10 years, 9 months ago](https://wordpress.org/support/topic/wrong-dates-and-days-combinations/#post-5478542)
 * Status: not resolved