From 7471c2504aa3a2864cc1c0be450e4876fe1fad43 Mon Sep 17 00:00:00 2001 From: ziqiangao <88281267+ziqiangao@users.noreply.github.com> Date: Sun, 20 Aug 2023 02:58:57 +0100 Subject: [PATCH] -SIPC-/time: fix grammar and Timedata block (#904) --- extensions/-SIPC-/time.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/extensions/-SIPC-/time.js b/extensions/-SIPC-/time.js index f6ed303f4a..9343f52677 100644 --- a/extensions/-SIPC-/time.js +++ b/extensions/-SIPC-/time.js @@ -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, @@ -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, @@ -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' } } @@ -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();