Skip to content

Commit

Permalink
-SIPC-/time: fix grammar and Timedata block (#904)
Browse files Browse the repository at this point in the history
  • Loading branch information
ziqiangao authored Aug 20, 2023
1 parent 2600025 commit 7471c25
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions extensions/-SIPC-/time.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,19 @@
{
opcode: 'Timestamp',
blockType: Scratch.BlockType.REPORTER,
text: 'The current timestamp',
text: 'current timestamp',
arguments: {}
},
{
opcode: 'timezone',
blockType: Scratch.BlockType.REPORTER,
text: 'The current time zone',
text: 'current time zone',
arguments: {}
},
{
opcode: 'Timedata',
blockType: Scratch.BlockType.REPORTER,
text: 'Extract [Timedata] from [timestamp]',
text: 'get [Timedata] from [timestamp]',
arguments: {
timestamp: {
type: Scratch.ArgumentType.NUMBER,
Expand All @@ -48,7 +48,7 @@
{
opcode: 'TimestampToTime',
blockType: Scratch.BlockType.REPORTER,
text: 'Converts [timestamp] to a datetime',
text: 'convert [timestamp] to datetime',
arguments: {
timestamp: {
type: Scratch.ArgumentType.NUMBER,
Expand All @@ -59,10 +59,10 @@
{
opcode: 'TimeToTimestamp',
blockType: Scratch.BlockType.REPORTER,
text: 'Converts [time] to a timestamp',
text: 'convert [time] to timestamp',
arguments: {
time: {
type: Scratch.ArgumentType.NUMBER,
type: Scratch.ArgumentType.STRING,
defaultValue: '2006-04-16 06:59:40'
}
}
Expand All @@ -84,7 +84,7 @@
}
Timedata(args) {
args.timestamp = args.timestamp ? args.timestamp : null;
let date1 = new Date(args.timestamp);
let date1 = new Date(Scratch.Cast.toNumber(args.timestamp));
switch (args.Timedata) {
case 'year':
return date1.getFullYear();
Expand Down

0 comments on commit 7471c25

Please sign in to comment.