Skip to content

Commit ab2d4c0

Browse files
committed
Version 21.1.1
2 parents ee3ad28 + 254badb commit ab2d4c0

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

Changelog.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
Changelog
22
=========
33

4+
## version 21.1.1
5+
6+
Fixes a bug when weeks are configured to start on Monday and the first day of the month falls on a Sunday.
7+
8+
49
## version 21.1
510

611
### Added:
@@ -10,7 +15,7 @@ Changelog
1015
+ Customizable color schemes for the digital wallpaper calendar;
1116
+ Classic and Modern styles for the desktop and wall calendars;
1217
+ Selectable paper aspect ratio for optimal printing results;
13-
+ Customizable initial day of week (Sunday or Monday).
18+
+ Configurable initial day of week (Sunday or Monday).
1419

1520
### Improved:
1621

js/desktopCal.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
* You should have received a copy of the GNU Affero General Public License
2020
* along with this program. If not, see <https://www.gnu.org/licenses/>.
2121
*/
22-
var _VERSION = '21.1';
22+
var _VERSION = '21.1.1';
2323

2424
var cropper = [],
2525
colorPresets;
@@ -401,7 +401,7 @@ function generateCalendar( month, year, canvas = null ) {
401401
}
402402
else
403403
html += `<th${ i == 0 ? ' class="holiday"' : ''}>${ msg[ lang ].weekDays[ i ] }`;
404-
i = i < 6 ? i + 1 : 0;
404+
i = ++i % 7;
405405
} while ( i != initialWeekday );
406406

407407
// if there are empty cells at the beginning, these are previous month's days
@@ -411,7 +411,7 @@ function generateCalendar( month, year, canvas = null ) {
411411
html += '<tr>'
412412
if ( dow != initialWeekday ) {
413413
let i = initialWeekday,
414-
d = ndays[ prevMon ] - dow + initialWeekday + 1;
414+
d = ndays[ prevMon ] - ( dow < initialWeekday ? dow + 7 : dow ) + initialWeekday + 1;
415415
do {
416416
html += '<td class="prev-month' + ( i == 0 || checkHoliday( month == 1 ? year - 1 : year, prevMon, d ).length ? ' holiday' : '' ) + '">' + d;
417417
i = ++i % 7;

0 commit comments

Comments
 (0)