getDay is zero-based where Sunday = 0; Sunday should be 1

This commit is contained in:
liam4 2016-09-02 10:20:54 -03:00
parent 602cb47a1e
commit 1437a358e1
No known key found for this signature in database
GPG key ID: 3A7605D17C36EF05

View file

@ -48,7 +48,7 @@ Scratch3SensingBlocks.prototype.current = function (args) {
case 'year': return date.getFullYear(); case 'year': return date.getFullYear();
case 'month': return date.getMonth() + 1; // getMonth is zero-based case 'month': return date.getMonth() + 1; // getMonth is zero-based
case 'date': return date.getDate(); case 'date': return date.getDate();
case 'dayofweek': return date.getDay(); case 'dayofweek': return date.getDay() + 1; // getDay is zero-based, Sun=0
case 'hour': return date.getHours(); case 'hour': return date.getHours();
case 'minute': return date.getMinutes(); case 'minute': return date.getMinutes();
case 'second': return date.getSeconds(); case 'second': return date.getSeconds();