Commit d513a4bd authored by Choi Ga Young's avatar Choi Ga Young
Browse files

불필요한거 삭제 및 함수이름변경

parent ff89d354
...@@ -4,7 +4,6 @@ import ChartY from './ChartY'; ...@@ -4,7 +4,6 @@ import ChartY from './ChartY';
import chartApi from './db/chartData.api'; import chartApi from './db/chartData.api';
import ButtonsForm from './components/ButtonsForm'; import ButtonsForm from './components/ButtonsForm';
import { View, Dimensions } from 'react-native'; import { View, Dimensions } from 'react-native';
const screenWidth = Dimensions.get("window").width;
const Analy = () => { const Analy = () => {
const date = new Date(); const date = new Date();
......
import React from 'react'; import React from 'react';
import { StyleSheet } from 'react-native';
import { NavigationContainer } from '@react-navigation/native'; import { NavigationContainer } from '@react-navigation/native';
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs'; import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';
import { createStackNavigator } from '@react-navigation/stack'; import { createStackNavigator } from '@react-navigation/stack';
...@@ -15,7 +14,6 @@ import MemoPage from './MemoPage'; ...@@ -15,7 +14,6 @@ import MemoPage from './MemoPage';
import MemoDetails from './screens/MemoDetails'; import MemoDetails from './screens/MemoDetails';
import EditOption from './EditOption'; import EditOption from './EditOption';
const Tab = createBottomTabNavigator(); const Tab = createBottomTabNavigator();
const Stack = createStackNavigator(); const Stack = createStackNavigator();
...@@ -38,7 +36,7 @@ function Home() { ...@@ -38,7 +36,7 @@ function Home() {
}, },
})} })}
tabBarOptions={{ tabBarOptions={{
activeTintColor: 'skyblue', activeTintColor: '#bfd3f2',
inactiveTintColor: 'gray', inactiveTintColor: 'gray',
}}> }}>
<Tab.Screen name="Main" component={MainScreen} /> <Tab.Screen name="Main" component={MainScreen} />
...@@ -95,21 +93,4 @@ function App() { ...@@ -95,21 +93,4 @@ function App() {
); );
} }
const style = StyleSheet.create({
TextInput: {
borderColor: 'skyblue',
height: 40,
margin: 12,
borderWidth: 1
},
Font: {
fontSize: 24
},
Contents: {
justifyContent: "center",
alignItems: "center",
margin: 10
}
});
export default App; export default App;
...@@ -51,7 +51,6 @@ const DetailInfo = ({ route }) => { ...@@ -51,7 +51,6 @@ const DetailInfo = ({ route }) => {
<Text style={{ textAlign: "center", fontSize: 20, fontFamily: 'GowunDodum-Regular' }}>내역이 없습니다.</Text> <Text style={{ textAlign: "center", fontSize: 20, fontFamily: 'GowunDodum-Regular' }}>내역이 없습니다.</Text>
</View> </View>
} }
</SafeAreaView> </SafeAreaView>
</> </>
) )
......
...@@ -18,7 +18,7 @@ const ChartY = ({ resDataY, year, setYear }) => { ...@@ -18,7 +18,7 @@ const ChartY = ({ resDataY, year, setYear }) => {
strokeWidth: 2, // optional, default 3 strokeWidth: 2, // optional, default 3
barPercentage: 0.5, // 그래프 width barPercentage: 0.5, // 그래프 width
useShadowColorFromDataset: false,// optional, default is false useShadowColorFromDataset: false,// optional, default is false
fillShadowGradientOpacity: 1, // 좀 더 진하게만 할 뿐 단색 설정은 못하는 것 같음 fillShadowGradientOpacity: 1,
}; };
const prevBtn = () => { const prevBtn = () => {
setYear(year - 1) setYear(year - 1)
...@@ -28,25 +28,19 @@ const ChartY = ({ resDataY, year, setYear }) => { ...@@ -28,25 +28,19 @@ const ChartY = ({ resDataY, year, setYear }) => {
} }
const convertY = (y) => { const convertY = (y) => {
console.log('convert y=====', y)
let res = ''; let res = '';
if (y >= 1000000000) { if (y >= 1000000000) {
res = (y / 1000000000).toFixed(2) + "B" res = (y / 1000000000).toFixed(2) + "B"
console.log('단위변환중', res)
} else if (y >= 1000000) { } else if (y >= 1000000) {
res = (y / 1000000).toFixed(2) + "M" res = (y / 1000000).toFixed(2) + "M"
console.log('단위변환중', res)
} else if (y >= 1000) { } else if (y >= 1000) {
res = (y / 1000).toFixed(2) + "K" res = (y / 1000).toFixed(2) + "K"
console.log('단위변환중', res)
} }
return res return res
} }
console.log('잠만확인', resDataY.temp1[0].datasets[0].data, '|', resDataY.temp2[0].datasets[0].data)
let totalYI = (resDataY.temp1[0].datasets[0].data).reduce((acc, curr) => acc + curr, 0); let totalYI = (resDataY.temp1[0].datasets[0].data).reduce((acc, curr) => acc + curr, 0);
let totalYO = (resDataY.temp2[0].datasets[0].data).reduce((acc, curr) => acc + curr, 0); let totalYO = (resDataY.temp2[0].datasets[0].data).reduce((acc, curr) => acc + curr, 0);
console.log('합산 확인', totalYI, '|', totalYO)
return ( return (
<> <>
......
import React, { useEffect, useState } from 'react'; import React, { useEffect, useState } from 'react';
import { StyleSheet, Text, View, FlatList, TouchableOpacity, Modal, TouchableWithoutFeedback, Keyboard } from 'react-native'; import { StyleSheet, View, FlatList, TouchableOpacity, Modal, TouchableWithoutFeedback, Keyboard } from 'react-native';
import TodoItem from './components/TodoItem'; import TodoItem from './components/TodoItem';
import Ionicons from 'react-native-vector-icons/Ionicons'; import Ionicons from 'react-native-vector-icons/Ionicons';
import MemoForm from './screens/MemoForm'; import MemoForm from './screens/MemoForm';
import memoApi from './db/memoPage.api'; import memoApi from './db/memoPage.api';
function MemoPage({ navigation }) { function MemoPage({ navigation }) {
const [memos, setMemos] = useState([]) const [memos, setMemos] = useState([]);
const [selectedIndex, setSelectedIndex] = useState(0)
const [modalOpen, setModalOpen] = useState(false); const [modalOpen, setModalOpen] = useState(false);
const loadMemos = async () => { const loadMemos = async () => {
...@@ -20,7 +19,6 @@ function MemoPage({ navigation }) { ...@@ -20,7 +19,6 @@ function MemoPage({ navigation }) {
} }
} }
const addInfo = async (info) => { const addInfo = async (info) => {
await memoApi.insertMemo(info) await memoApi.insertMemo(info)
setModalOpen(false); setModalOpen(false);
...@@ -32,20 +30,15 @@ function MemoPage({ navigation }) { ...@@ -32,20 +30,15 @@ function MemoPage({ navigation }) {
loadMemos(); loadMemos();
} }
useEffect(() => { useEffect(() => {
loadMemos() loadMemos()
}, []) }, [])
return ( return (
<TouchableWithoutFeedback onPress={() => { <TouchableWithoutFeedback onPress={() => {
Keyboard.dismiss(); Keyboard.dismiss();
}}> }}>
<View Style={style.container}> <View Style={style.container}>
<View style={{ width: '100%', height: '95%' }} > <View style={{ width: '100%', height: '95%' }} >
<View style={{ width: '100%', height: '80%' }}> <View style={{ width: '100%', height: '80%' }}>
<View > <View >
...@@ -58,12 +51,11 @@ function MemoPage({ navigation }) { ...@@ -58,12 +51,11 @@ function MemoPage({ navigation }) {
)} )}
/> />
</View> </View>
</View> </View>
<Ionicons <Ionicons
name='add' name='add'
size={24} size={24}
style={style.modalToggle} //...은 중괄호를 풀어서 합치려고 이용함 style={style.modalToggle}
onPress={() => setModalOpen(true)} onPress={() => setModalOpen(true)}
/> />
</View> </View>
...@@ -77,7 +69,6 @@ function MemoPage({ navigation }) { ...@@ -77,7 +69,6 @@ function MemoPage({ navigation }) {
onPress={() => setModalOpen(false)} onPress={() => setModalOpen(false)}
/> />
<MemoForm addInfo={addInfo} /> <MemoForm addInfo={addInfo} />
</View> </View>
</Modal> </Modal>
</View> </View>
...@@ -105,10 +96,9 @@ const style = StyleSheet.create({ ...@@ -105,10 +96,9 @@ const style = StyleSheet.create({
}, },
modalContent: { modalContent: {
flex: 1, //이후 유용한 키보드를 추가하려고 ex)dismissing keyboard flex: 1,
}, },
TextInput: { TextInput: {
borderColor: 'skyblue', borderColor: 'skyblue',
height: 40, height: 40,
......
...@@ -6,7 +6,7 @@ import SelectForm from './components/SelectForm'; ...@@ -6,7 +6,7 @@ import SelectForm from './components/SelectForm';
import StyledButton from './components/StyledButton'; import StyledButton from './components/StyledButton';
import DatePicker from './components/DatePicker'; import DatePicker from './components/DatePicker';
import moneyApi from './db/postMoney.api'; import moneyApi from './db/postMoney.api';
import { getDate } from './utils/dateFunction' import { getDateStr } from './utils/dateFunction'
const INIT_ASSETSTYPE = { const INIT_ASSETSTYPE = {
id: 1, id: 1,
...@@ -24,9 +24,9 @@ const INIT_SUBCATEGORY = { ...@@ -24,9 +24,9 @@ const INIT_SUBCATEGORY = {
foreign_id: 0, foreign_id: 0,
} }
const PostMoney = ({navigation}) => { const PostMoney = ({ navigation }) => {
const [selectedIndex, setSelectedIndex] = useState(0) const [selectedIndex, setSelectedIndex] = useState(0)
const [date, setDate] = useState(getDate()) const [date, setDate] = useState(getDateStr())
const [contents, setContents] = useState('') const [contents, setContents] = useState('')
const [price, setPrice] = useState('') const [price, setPrice] = useState('')
const [asset_type, setAsset_type] = useState([]) const [asset_type, setAsset_type] = useState([])
...@@ -110,15 +110,16 @@ const PostMoney = ({navigation}) => { ...@@ -110,15 +110,16 @@ const PostMoney = ({navigation}) => {
} }
const onUpdateCatPress = () => { const onUpdateCatPress = () => {
navigation.navigate('EditOption', selectedIndex+1) navigation.navigate('EditOption', selectedIndex + 1)
} }
const onUpdateAssetPress = () => { const onUpdateAssetPress = () => {
navigation.navigate('EditOption', 0) navigation.navigate('EditOption', 0)
} }
if(success){ if (success) {
initData() initData()
setSuccess(false) setSuccess(false)
} }
......
...@@ -2,6 +2,7 @@ import React, { useState, useEffect } from 'react'; ...@@ -2,6 +2,7 @@ import React, { useState, useEffect } from 'react';
import { SafeAreaView, StyleSheet, View, Text, FlatList, TouchableOpacity } from 'react-native'; import { SafeAreaView, StyleSheet, View, Text, FlatList, TouchableOpacity } from 'react-native';
import { Button } from 'react-native-elements'; import { Button } from 'react-native-elements';
import Ionicons from 'react-native-vector-icons/Ionicons'; import Ionicons from 'react-native-vector-icons/Ionicons';
import { getDateStr } from '../utils/dateFunction';
const DateItem = ({ dateitem, textColor, onPress, flatListHeight }) => { const DateItem = ({ dateitem, textColor, onPress, flatListHeight }) => {
return ( return (
...@@ -104,7 +105,7 @@ function Calendar({ ...@@ -104,7 +105,7 @@ function Calendar({
} }
return ( return (
<DateItem dateitem={item} textColor={{ color }} onPress={() => navigation.navigate('CalDetail', String(item.date.toJSON()).split(/T/)[0])} flatListHeight={flatListHeight / (Dates.length / 7)} /> <DateItem dateitem={item} textColor={{ color }} onPress={() => navigation.navigate('CalDetail', getDateStr(item.date))} flatListHeight={flatListHeight / (Dates.length / 7)} />
) )
} }
const prevBtn = () => { const prevBtn = () => {
...@@ -170,19 +171,19 @@ function Calendar({ ...@@ -170,19 +171,19 @@ function Calendar({
}; };
const style = StyleSheet.create({ const style = StyleSheet.create({
EntContainer: { //전체 (SafeAreaView) EntContainer: {
flex: 1, flex: 1,
padding: 20 padding: 20
}, },
Head: { //00년00월 Head: {
fontSize: 24, fontSize: 24,
fontFamily: 'GowunDodum-Regular' fontFamily: 'GowunDodum-Regular'
}, },
Container: { //년월, 버튼 뷰에 적용 Container: {
justifyContent: "center", justifyContent: "center",
alignItems: "center", alignItems: "center",
}, },
dateContainer: { //각 date에 적용 (Text 태그), DateItem 컴포넌트에 적용 dateContainer: {
flex: 1, flex: 1,
borderWidth: 0.8, borderWidth: 0.8,
borderColor: '#DCDCDC' borderColor: '#DCDCDC'
...@@ -194,7 +195,6 @@ const style = StyleSheet.create({ ...@@ -194,7 +195,6 @@ const style = StyleSheet.create({
Days: { Days: {
flexDirection: 'row', flexDirection: 'row',
backgroundColor: '#6495ED' backgroundColor: '#6495ED'
}, },
DayText: { DayText: {
flex: 1, flex: 1,
......
import React, { useState } from "react"; import React, { useState } from "react";
import { Button, View, Text, StyleSheet, Pressable } from "react-native"; import { Button, View, Text, StyleSheet, Pressable } from "react-native";
import DateTimePickerModal from "react-native-modal-datetime-picker"; import DateTimePickerModal from "react-native-modal-datetime-picker";
import { getDateStr } from '../utils/dateFunction';
const DatePicker = (props) => { const DatePicker = (props) => {
const [isDatePickerVisible, setDatePickerVisibility] = useState(false); const [isDatePickerVisible, setDatePickerVisibility] = useState(false);
...@@ -14,8 +15,7 @@ const DatePicker = (props) => { ...@@ -14,8 +15,7 @@ const DatePicker = (props) => {
}; };
const handleConfirm = (date) => { const handleConfirm = (date) => {
console.log("A date has been picked: ", String(date.toJSON()).split(/T/)[0]); props.setDate(getDateStr(date))
props.setDate(String(date.toJSON()).split(/T/)[0])
hideDatePicker(); hideDatePicker();
}; };
......
import React, { useEffect, useState } from 'react'; import React, { useEffect, useState } from 'react';
import { StyleSheet, View, Text, Button, Pressable, TouchableWithoutFeedback, Keyboard } from 'react-native'; import { StyleSheet, View, TouchableWithoutFeedback, Keyboard } from 'react-native';
import { globalStyles } from '../styles/global';
import InputBox from '../components/InputBox'; import InputBox from '../components/InputBox';
import StyledButton from '../components/StyledButton'; import StyledButton from '../components/StyledButton';
import DatePicker from '../components/DatePicker.js'; import DatePicker from '../components/DatePicker.js';
import deptApi from '../db/deptPage.api'; import deptApi from '../db/deptPage.api';
import { getDateStr } from '../utils/dateFunction';
function DeptDetails({ route, navigation }) { function DeptDetails({ route, navigation }) {
const { item, loadLoan } = route.params const { item, loadLoan } = route.params
const getDate = () => { const getDates = () => {
var date = new Date(); const date = new Date();
return (String(date.toJSON()).split(/T/)[0]) return (getDateStr(date))
} }
const [date, setDate] = useState(getDate()) const [date, setDate] = useState(getDates())
const [message, setMessage] = useState('') const [message, setMessage] = useState('')
const [money, setMoney] = useState('') const [money, setMoney] = useState('')
const [remained_money, setRemained_money] = useState('') const [remained_money, setRemained_money] = useState('')
...@@ -28,9 +28,7 @@ function DeptDetails({ route, navigation }) { ...@@ -28,9 +28,7 @@ function DeptDetails({ route, navigation }) {
await deptApi.updateDept({ date, message, money, remained_money }, item.id) await deptApi.updateDept({ date, message, money, remained_money }, item.id)
loadLoan() loadLoan()
navigation.navigate('DeptPage') navigation.navigate('DeptPage')
} }
return ( return (
<TouchableWithoutFeedback onPress={() => { <TouchableWithoutFeedback onPress={() => {
Keyboard.dismiss(); Keyboard.dismiss();
...@@ -76,8 +74,6 @@ function DeptDetails({ route, navigation }) { ...@@ -76,8 +74,6 @@ function DeptDetails({ route, navigation }) {
) )
} }
const style = StyleSheet.create({ const style = StyleSheet.create({
Font: { Font: {
...@@ -101,7 +97,4 @@ const style = StyleSheet.create({ ...@@ -101,7 +97,4 @@ const style = StyleSheet.create({
} }
}); });
export default DeptDetails; export default DeptDetails;
\ No newline at end of file
import React, { useState } from 'react'; import React from 'react';
import { StyleSheet, Button, View, Text, TextInput, TouchableWithoutFeedback, Keyboard } from 'react-native'; import { Button, View, TouchableWithoutFeedback, Keyboard } from 'react-native';
import { globalStyles } from '../styles/global.js' import { globalStyles } from '../styles/global.js'
import { Formik } from 'formik'; import { Formik } from 'formik';
import * as yup from 'yup'; import * as yup from 'yup';
import DatePicker from '../components/DatePicker.js'; import DatePicker from '../components/DatePicker.js';
import InputBox from '../components/InputBox'; import InputBox from '../components/InputBox';
import { getDateStr } from '../utils/dateFunction';
const ReviewSchema = yup.object({ const ReviewSchema = yup.object({
date: yup.string() //string만 받는다 date: yup.string()
.required(), //아무것도 입력안했하면 안받음 .required(),
message: yup.string() message: yup.string()
.required() .required()
.min(2), .min(2),
...@@ -18,11 +19,10 @@ const ReviewSchema = yup.object({ ...@@ -18,11 +19,10 @@ const ReviewSchema = yup.object({
.required() .required()
}) })
const getDate = () => { const getDates = () => {
var date = new Date(); const date = new Date();
return (String(date.toJSON()).split(/T/)[0]) return (getDateStr(date))
} }
// const [date, setDate] = useState(getDate())
function DeptForm({ addInfo }) { function DeptForm({ addInfo }) {
return ( return (
...@@ -33,51 +33,42 @@ function DeptForm({ addInfo }) { ...@@ -33,51 +33,42 @@ function DeptForm({ addInfo }) {
<Formik <Formik
initialValues={{ date: '', message: '', money: '', remained_money: '' }} initialValues={{ date: '', message: '', money: '', remained_money: '' }}
validationSchema={ReviewSchema} validationSchema={ReviewSchema}
onSubmit={(values) => {//위의 4개의 val들을 전달 onSubmit={(values) => {
addInfo(values); addInfo(values);
}} }}
> >
{({ handleChange, handleSubmit, values }) => ( {({ handleChange, handleSubmit, values }) => (
<View> <View>
<DatePicker <DatePicker
inputTitle='날짜' inputTitle='날짜'
date={values.date || getDate()}//오늘날짜 아니면 바뀐날짜 date={values.date || getDates()}
setDate={handleChange('date')} setDate={handleChange('date')}
/> />
<InputBox <InputBox
inputTitle="내용" inputTitle="내용"
onChangeText={handleChange('message')} onChangeText={handleChange('message')}
value={values.message} value={values.message}
/> />
<InputBox <InputBox
inputTitle="금액" inputTitle="금액"
onChangeText={handleChange('money')} onChangeText={handleChange('money')}
value={values.money} value={values.money}
keyboardType="numeric" keyboardType="numeric"
/> />
<InputBox <InputBox
inputTitle="남은금액" inputTitle="남은금액"
onChangeText={handleChange('remained_money')} onChangeText={handleChange('remained_money')}
value={values.remained_money} value={values.remained_money}
keyboardType="numeric" keyboardType="numeric"
/> />
<View style={{ marginVertical: '10%', marginHorizontal: 10 }}> <View style={{ marginVertical: '10%', marginHorizontal: 10 }}>
<Button title='입력' color = 'dodgerblue' onPress={handleSubmit} /> <Button title='입력' color='dodgerblue' onPress={handleSubmit} />
</View> </View>
</View> </View>
)} )}
</Formik> </Formik>
</View > </View >
</TouchableWithoutFeedback> </TouchableWithoutFeedback>
) )
......
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect } from 'react';
import { StyleSheet, View, Text, Button, Pressable, TouchableWithoutFeedback, Keyboard } from 'react-native'; import { StyleSheet, View, TouchableWithoutFeedback, Keyboard } from 'react-native';
import { globalStyles } from '../styles/global';
import InputBox from '../components/InputBox'; import InputBox from '../components/InputBox';
import StyledButton from '../components/StyledButton'; import StyledButton from '../components/StyledButton';
import DatePicker from '../components/DatePicker.js'; import DatePicker from '../components/DatePicker.js';
import memoApi from '../db/memoPage.api'; import memoApi from '../db/memoPage.api';
import { getDateStr } from '../utils/dateFunction';
function MemoDetails({ route, navigation }) { function MemoDetails({ route, navigation }) {
const {item, loadMemos} = route.params const { item, loadMemos } = route.params
const getDate = () => { const getDates = () => {
var date = new Date(); const date = new Date();
return (String(date.toJSON()).split(/T/)[0]) return (getDateStr(date))
} }
const [date, setDate] = useState(getDate()) const [date, setDate] = useState(getDates())
const [message, setMessage] = useState('') const [message, setMessage] = useState('')
const onUpdateHandle = async () => { const onUpdateHandle = async () => {
await memoApi.updateMemo({ date, message }, item.id) await memoApi.updateMemo({ date, message }, item.id)
loadMemos() loadMemos()
navigation.navigate('MemoPage') navigation.navigate('MemoPage')
// navigation.goBack()
// navigation.dispatch( navigation.navigate('MemoPage'));
} }
useEffect(() => { useEffect(() => {
...@@ -61,8 +57,6 @@ function MemoDetails({ route, navigation }) { ...@@ -61,8 +57,6 @@ function MemoDetails({ route, navigation }) {
) )
} }
const style = StyleSheet.create({ const style = StyleSheet.create({
buttonRow: { buttonRow: {
...@@ -81,7 +75,4 @@ const style = StyleSheet.create({ ...@@ -81,7 +75,4 @@ const style = StyleSheet.create({
} }
}); });
export default MemoDetails; export default MemoDetails;
\ No newline at end of file
import React, { useState } from 'react'; import React from 'react';
import { StyleSheet, Button, View, Text, TouchableWithoutFeedback, Keyboard } from 'react-native'; import { Button, View, TouchableWithoutFeedback, Keyboard } from 'react-native';
import { globalStyles } from '../styles/global.js' import { globalStyles } from '../styles/global.js'
import { Formik } from 'formik'; import { Formik } from 'formik';
import * as yup from 'yup'; import * as yup from 'yup';
import DatePicker from '../components/DatePicker.js'; import DatePicker from '../components/DatePicker.js';
import InputBox from '../components/InputBox.js'; import InputBox from '../components/InputBox.js';
import { getDateStr } from '../utils/dateFunction';
const ReviewSchema = yup.object({ const ReviewSchema = yup.object({
// date: yup.string() //string만 받는다 date: yup.string()
// .required() //아무것도 입력안했하면 안받음 .required(),
// , //최소4글짜
message: yup.string() message: yup.string()
.required() .required()
.min(2), .min(2),
}) })
const getDate = () => { const getDates = () => {
var date = new Date(); const date = new Date();
return (String(date.toJSON()).split(/T/)[0]) return (getDateStr(date))
} }
function MemoForm({ addInfo }) { function MemoForm({ addInfo }) {
return ( return (
<TouchableWithoutFeedback onPress={() => { <TouchableWithoutFeedback onPress={() => {
...@@ -31,8 +30,7 @@ function MemoForm({ addInfo }) { ...@@ -31,8 +30,7 @@ function MemoForm({ addInfo }) {
<Formik <Formik
initialValues={{ date: '', message: '' }} initialValues={{ date: '', message: '' }}
validationSchema={ReviewSchema} validationSchema={ReviewSchema}
onSubmit={(values) => {//위의 4개의 val들을 전달 onSubmit={(values) => {
addInfo(values); addInfo(values);
}} }}
...@@ -41,7 +39,7 @@ function MemoForm({ addInfo }) { ...@@ -41,7 +39,7 @@ function MemoForm({ addInfo }) {
<View> <View>
<DatePicker <DatePicker
inputTitle='날짜' inputTitle='날짜'
date={values.date || getDate()}//오늘날짜 아니면 바뀐날짜 date={values.date || getDates()}
setDate={handleChange('date')} setDate={handleChange('date')}
/> />
<InputBox <InputBox
...@@ -50,7 +48,6 @@ function MemoForm({ addInfo }) { ...@@ -50,7 +48,6 @@ function MemoForm({ addInfo }) {
value={values.message} value={values.message}
/> />
<View style={{ marginVertical: '10%', marginHorizontal: 10 }}> <View style={{ marginVertical: '10%', marginHorizontal: 10 }}>
<Button title='입력' color='dodgerblue' onPress={handleSubmit} /> <Button title='입력' color='dodgerblue' onPress={handleSubmit} />
</View> </View>
......
export function getDate(item) { export function getDateStr(item) {
let date = '' let date = ''
if (item) { if (item) {
date = new Date(item) date = new Date(item)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment