Skip to content

Commit

Permalink
Merge pull request #137 from yeonjulee1005/stage
Browse files Browse the repository at this point in the history
🚗 [version: 2.2.0] push to master
  • Loading branch information
yeonjulee1005 authored Jan 14, 2024
2 parents e5b8972 + c76b8c4 commit 197d0b4
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 13 deletions.
4 changes: 2 additions & 2 deletions components/Header/Forecast.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
/>
<AIconText
:use-icon="false"
:text="'자외선'"
:text="$t('main.forecast.uv')"
/>
<AIconText
:custom-class="uvColor(uvData.uvIndex)"
Expand All @@ -43,7 +43,7 @@
/>
<AIconText
:use-icon="false"
:text="'대기질'"
:text="$t('main.forecast.diffusion')"
/>
<AIconText
:custom-class="airDiffusionColor(airDiffusionData.diffusionIndex)"
Expand Down
2 changes: 1 addition & 1 deletion composables/util/ui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export const useUi = () => {
}

const getLastHour = () => {
return String(parseInt(genDateFormat('HH')) - 1)
return dayjs(new Date()).subtract(1, 'hour').format('HH')
}

const getMinute = (format: string) => {
Expand Down
4 changes: 4 additions & 0 deletions locales/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ export default {
],
scroll: '👇🏻 Scroll Down'
},
forecast: {
uv: 'UV',
diffusion: 'Air Exposed'
},
resume: {
title: 'RESUME'
},
Expand Down
4 changes: 4 additions & 0 deletions locales/ko.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ export default {
],
scroll: '👇🏻 아래로 스크롤'
},
forecast: {
uv: '자외선',
diffusion: '대기정체'
},
resume: {
title: 'RESUME'
},
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"name": "Dewdew",
"email": "yeonju.lee1005@gmail.com"
},
"version": "2.1.2",
"version": "2.2.0",
"private": true,
"scripts": {
"build": "nuxt build",
Expand Down
18 changes: 9 additions & 9 deletions stores/locationWeatherData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,16 +74,16 @@ export const useLocWeatherStore = defineStore('weatherData', () => {

const recordWeatherData = (response: WeatherItem[]) => {
weatherFirstData.value = {
sky: getWeatherData('sky', filterLastData(response, 'SKY')?.fcstValue ?? 0),
t1h: getWeatherData('t1h', filterLastData(response, 'T1H')?.fcstValue ?? 0),
vec: getWeatherData('vec', Math.floor((parseInt(filterLastData(response, 'VEC')?.fcstValue ?? '0') + 22.5) / 45)),
wsd: getWeatherData('wsd', filterLastData(response, 'WSD')?.fcstValue ?? 0)
sky: getWeatherData('sky', filterWeatherData(response, 'SKY', 0)?.fcstValue ?? 0),
t1h: getWeatherData('t1h', filterWeatherData(response, 'T1H', 0)?.fcstValue ?? 0),
vec: getWeatherData('vec', Math.floor((parseInt(filterWeatherData(response, 'VEC', 0)?.fcstValue ?? '0') + 22.5) / 45)),
wsd: getWeatherData('wsd', filterWeatherData(response, 'WSD', 0)?.fcstValue ?? 0)
}

weatherSecondData.value = {
pty: getWeatherData('pty', filterLastData(response, 'PTY')?.fcstValue ?? 0),
r1n: getWeatherData('r1n', filterLastData(response, 'RN1')?.fcstValue ?? 0),
reh: getWeatherData('reh', filterLastData(response, 'REH')?.fcstValue ?? 0)
pty: getWeatherData('pty', filterWeatherData(response, 'PTY', 0)?.fcstValue ?? 0),
r1n: getWeatherData('r1n', filterWeatherData(response, 'RN1', 0)?.fcstValue ?? 0),
reh: getWeatherData('reh', filterWeatherData(response, 'REH', 0)?.fcstValue ?? 0)
}
}

Expand All @@ -92,8 +92,8 @@ export const useLocWeatherStore = defineStore('weatherData', () => {
return typeof data === 'function' ? data(value) : data[value as number]
}

const filterLastData = (data: WeatherItem[], category: string) => {
return data.filter((item: WeatherItem) => item.category === category).at(-1)
const filterWeatherData = (data: WeatherItem[], category: string, index:number) => {
return data.filter((item: WeatherItem) => item.category === category).at(index)
}

return {
Expand Down

0 comments on commit 197d0b4

Please sign in to comment.