Skip to content

Commit

Permalink
refactoring: data formatting 분리
Browse files Browse the repository at this point in the history
  • Loading branch information
yuni committed Apr 30, 2024
1 parent c1f50f9 commit daeea43
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions frontend/src/pages/HomeScreen.js
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@ import {
Dimensions,
} from 'react-native'
import { dateApiKey } from '../data/apiKey'
import { formatOperation, formatHoliday } from '../utils/dateUtils'
import { formatOperation, formatHoliday, formatDate } from '../utils/dateUtils'
import operation from '../data/operation.json'
import knuEvent from '../data/knuEvent.json'
import Round from '../components/Round'
@@ -143,17 +143,6 @@ const HomeScreen = () => {
checkHoliday()
}, [selectedDate, holidays])

// 요일 계산 --------------------------------------------------------------
const formatDate = (date) => {
const weekDays = ['일', '월', '화', '수', '목', '금', '토']
const year = date.getFullYear()
const month = date.getMonth() + 1
const day = date.getDate()
const weekDay = weekDays[date.getDay()]

return `${year}${month}${day}일 (${weekDay})`
}

const dateColor = () => {
const weekDay = selectedDate.getDay()
return weekDay === 6
@@ -275,9 +264,6 @@ const styles = StyleSheet.create({
knuText: {
color: '#2c3e50',
},
defaultText: {
color: '#2c3e50',
},
roundContainer: {
flex: 1,
marginTop: scale(10),

0 comments on commit daeea43

Please sign in to comment.