diff --git a/src/playground/blocks/block_expansion_weather.js b/src/playground/blocks/block_expansion_weather.js index 027d3fee10..697af75ab9 100644 --- a/src/playground/blocks/block_expansion_weather.js +++ b/src/playground/blocks/block_expansion_weather.js @@ -32,6 +32,7 @@ Entry.EXPANSION_BLOCK.weather = { return; } Entry.EXPANSION_BLOCK.weather.date = new Date(); + Entry.EXPANSION_BLOCK.weather.localDate = new Date().toLocaleDateString().replaceAll('.', '').replaceAll(' ', '') Entry.EXPANSION_BLOCK.weather.getData('week', 'Seoul', 'today'); Entry.EXPANSION_BLOCK.weather.getData('hour', 'Seoul', '00'); Entry.EXPANSION_BLOCK.weather.getData('now', 'Seoul'); @@ -169,10 +170,7 @@ Entry.EXPANSION_BLOCK.weather = { default: break; } - return date - .toISOString() - .slice(0, 10) - .replace(/-/g, ''); + return date.toLocaleDateString().replaceAll('.', '').replaceAll(' ', ''); }, locationMap: { Seoul: { @@ -1205,10 +1203,7 @@ Entry.EXPANSION_BLOCK.weather.getBlocks = function() { parent: script.getField('LOCATION', script), sub: script.getField('SUBLOCATION', script), }; - const date = Entry.EXPANSION_BLOCK.weather.date - .toISOString() - .slice(0, 10) - .replace(/-/g, ''); + const date = Entry.EXPANSION_BLOCK.weather.localDate; let time = script.getField('TIME', script); // db에 저장하지 않으면서 00시가 없어져서 03시부터 가능.. if (time == '00') { @@ -1589,10 +1584,7 @@ Entry.EXPANSION_BLOCK.weather.getBlocks = function() { class: 'weather_legacy', isNotFor: ['weather_legacy'], async func(sprite, script) { - const date = Entry.EXPANSION_BLOCK.weather.date - .toISOString() - .slice(0, 10) - .replace(/-/g, ''); + const date = Entry.EXPANSION_BLOCK.weather.localDate; let time = script.getField('TIME', script); // db에 저장하지 않으면서 00시가 없어져서 03시부터 가능.. if (time == '00') { @@ -2050,10 +2042,7 @@ Entry.EXPANSION_BLOCK.weather.getBlocks = function() { isNotFor: ['weather'], async func(sprite, script) { const location = script.getValue('LOCATION', script); - const date = Entry.EXPANSION_BLOCK.weather.date - .toISOString() - .slice(0, 10) - .replace(/-/g, ''); + const date = Entry.EXPANSION_BLOCK.weather.localDate; let time = script.getField('TIME', script); // db에 저장하지 않으면서 00시가 없어져서 03시부터 가능.. if (time == '00') { @@ -2112,10 +2101,7 @@ Entry.EXPANSION_BLOCK.weather.getBlocks = function() { const location = script.getValue('LOCATION', script); const type = Entry.EXPANSION_BLOCK.weather.propertyHourMap[script.getField('TYPE', script)]; - const date = Entry.EXPANSION_BLOCK.weather.date - .toISOString() - .slice(0, 10) - .replace(/-/g, ''); + const date = Entry.EXPANSION_BLOCK.weather.localDate; let time = script.getField('TIME', script); // db에 저장하지 않으면서 00시가 없어져서 03시부터 가능.. if (time == '00') { @@ -2172,10 +2158,7 @@ Entry.EXPANSION_BLOCK.weather.getBlocks = function() { isNotFor: ['weather'], async func(sprite, script) { const location = script.getValue('LOCATION', script); - const date = Entry.EXPANSION_BLOCK.weather.date - .toISOString() - .slice(0, 10) - .replace(/-/g, ''); + const date = Entry.EXPANSION_BLOCK.weather.localDate; let time = script.getField('TIME', script); // db에 저장하지 않으면서 00시가 없어져서 03시부터 가능.. if (time == '00') {