Merge pull request #9135 from tschuettler/CRM-19424
authorYashodha Chaku <yashodha.chaku@webaccessglobal.com>
Thu, 29 Sep 2016 08:10:12 +0000 (13:40 +0530)
committerGitHub <noreply@github.com>
Thu, 29 Sep 2016 08:10:12 +0000 (13:40 +0530)
CRM-19424 - Weekday names if week does not start on Sunday

CRM/Utils/Date.php

index c9fc8b0ecdb555db9a27ded30c5bbe79e2a860c4..f04e3a04818c6413f93085fccf32d358e700fa31 100644 (file)
@@ -184,7 +184,7 @@ class CRM_Utils_Date {
       // set LC_TIME and build the arrays from locale-provided names
       // June 1st, 1970 was a Monday
       CRM_Core_I18n::setLcTime();
-      for ($i = $firstDay; count($days) < 7; $i = $i > 6 ? 0 : $i + 1) {
+      for ($i = $firstDay; count($days) < 7; $i = $i > 5 ? 0 : $i + 1) {
         $days[$i] = strftime('%a', mktime(0, 0, 0, 6, $i, 1970));
       }
     }
@@ -213,7 +213,7 @@ class CRM_Utils_Date {
       // set LC_TIME and build the arrays from locale-provided names
       // June 1st, 1970 was a Monday
       CRM_Core_I18n::setLcTime();
-      for ($i = $firstDay; count($days) < 7; $i = $i > 6 ? 0 : $i + 1) {
+      for ($i = $firstDay; count($days) < 7; $i = $i > 5 ? 0 : $i + 1) {
         $days[$i] = strftime('%A', mktime(0, 0, 0, 6, $i, 1970));
       }
     }