Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 7 additions & 24 deletions src/playground/blocks/block_expansion_weather.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(' ', '')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [eslint] <max-len> reported by reviewdog 🐶
This line has a length of 121. Maximum allowed is 100.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [eslint] <prettier/prettier> reported by reviewdog 🐶
Replace .toLocaleDateString().replaceAll('.',·'').replaceAll('·',·'') with ⏎············.toLocaleDateString()⏎············.replaceAll('.',·'')⏎············.replaceAll('·',·'');

Suggested change
Entry.EXPANSION_BLOCK.weather.localDate = new Date().toLocaleDateString().replaceAll('.', '').replaceAll(' ', '')
Entry.EXPANSION_BLOCK.weather.localDate = new Date()
.toLocaleDateString()
.replaceAll('.', '')
.replaceAll(' ', '');

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [eslint] <semi> reported by reviewdog 🐶
Missing semicolon.

Suggested change
Entry.EXPANSION_BLOCK.weather.localDate = new Date().toLocaleDateString().replaceAll('.', '').replaceAll(' ', '')
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');
Expand Down Expand Up @@ -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: {
Expand Down Expand Up @@ -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') {
Expand Down Expand Up @@ -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') {
Expand Down Expand Up @@ -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') {
Expand Down Expand Up @@ -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') {
Expand Down Expand Up @@ -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') {
Expand Down