Skip to content

Commit

Permalink
refactor: 侦测当前是一星期的第几天按照国际标准来
Browse files Browse the repository at this point in the history
  • Loading branch information
yangfeng1 committed Sep 18, 2024
1 parent 2f5e41f commit 90b1c5b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/blocks/scratch3_sensing.js
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ class Scratch3SensingBlocks {
case 'year': return date.getFullYear();
case 'month': return date.getMonth() + 1; // getMonth is zero-based
case 'date': return date.getDate();
case 'dayofweek': return date.getDay() + 1; // getDay is zero-based, Sun=0
case 'dayofweek': return date.getDay() || 7; // getDay is zero-based, Sun=0, 国际标准ISO 8601,星期一是一周的开始
case 'hour': return date.getHours();
case 'minute': return date.getMinutes();
case 'second': return date.getSeconds();
Expand Down

0 comments on commit 90b1c5b

Please sign in to comment.