Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
students
rich-maker
Commits
3912238f
Commit
3912238f
authored
Aug 08, 2021
by
YoonDongMin
Browse files
0808DM
parent
ff89d354
Changes
8
Show whitespace changes
Inline
Side-by-side
MainScreen.js
View file @
3912238f
import
React
,
{
useState
}
from
'
react
'
;
import
React
,
{
useState
}
from
'
react
'
;
import
{
View
,
Text
,
TextInput
,
StyleSheet
,
Button
,
Keyboard
,
TouchableWithoutFeedback
,
Modal
}
from
'
react-native
'
;
import
{
SpeedDial
}
from
'
react-native-elements
'
;
import
WeeklyCalendar
from
'
./components/WeeklyCalendar
'
;
...
...
@@ -36,15 +36,18 @@ function MainScreen({ navigation }) {
title
=
"
월별 페이지로 이동
"
onPress
=
{()
=>
navigation
.
navigate
(
'
Monthly
'
)}
/
>
<
SpeedDial
isOpen
=
{
open
}
icon
=
{{
name
:
'
edit
'
,
color
:
'
#fff
'
}}
//연필모양
openIcon
=
{{
name
:
'
close
'
,
color
:
'
#fff
'
}}
//x모양
icon
=
{{
name
:
'
edit
'
,
color
:
'
#fff
'
,
backgroundcolor
:
'
skyblue
'
}}
//연필모양
openIcon
=
{{
name
:
'
close
'
,
color
:
'
#fff
'
,
backgroundcolor
:
'
orange
'
}}
//x모양
onOpen
=
{()
=>
setOpen
(
!
open
)}
onClose
=
{()
=>
setOpen
(
!
open
)}
>
<
SpeedDial
.
Action
icon
=
{{
name
:
'
add
'
,
color
:
'
#fff
'
}}
icon
=
{{
name
:
'
add
'
,
color
:
'
white
'
}}
title
=
"
부채
"
onPress
=
{()
=>
navigation
.
navigate
(
'
DeptPage
'
)}
/
>
...
...
MemoPage.js
View file @
3912238f
...
...
@@ -7,7 +7,6 @@ import memoApi from './db/memoPage.api';
function
MemoPage
({
navigation
})
{
const
[
memos
,
setMemos
]
=
useState
([])
const
[
selectedIndex
,
setSelectedIndex
]
=
useState
(
0
)
const
[
modalOpen
,
setModalOpen
]
=
useState
(
false
);
const
loadMemos
=
async
()
=>
{
...
...
components/DatePicker.js
View file @
3912238f
import
React
,
{
useState
}
from
"
react
"
;
import
{
Button
,
View
,
Text
,
StyleSheet
,
Pressable
}
from
"
react-native
"
;
import
DateTimePickerModal
from
"
react-native-modal-datetime-picker
"
;
import
{
getDateStr
}
from
'
../utils/dateFunction
'
;
const
DatePicker
=
(
props
)
=>
{
const
[
isDatePickerVisible
,
setDatePickerVisibility
]
=
useState
(
false
);
...
...
@@ -14,8 +14,8 @@ const DatePicker = (props) => {
};
const
handleConfirm
=
(
date
)
=>
{
console
.
log
(
"
A date has been picked:
"
,
String
(
date
.
toJSON
()).
split
(
/T/
)[
0
]
);
props
.
setDate
(
String
(
date
.
toJSON
()).
split
(
/T/
)[
0
]
)
console
.
log
(
"
A date has been picked:
"
,
getDateStr
(
date
)
);
props
.
setDate
(
getDateStr
(
date
)
)
hideDatePicker
();
};
...
...
screens/DeptDetails.js
View file @
3912238f
...
...
@@ -5,14 +5,15 @@ import InputBox from '../components/InputBox';
import
StyledButton
from
'
../components/StyledButton
'
;
import
DatePicker
from
'
../components/DatePicker.js
'
;
import
deptApi
from
'
../db/deptPage.api
'
;
import
{
getDateStr
}
from
'
../utils/dateFunction
'
;
function
DeptDetails
({
route
,
navigation
})
{
const
{
item
,
loadLoan
}
=
route
.
params
const
getDate
=
()
=>
{
var
date
=
new
Date
();
return
(
String
(
date
.
toJSON
()).
split
(
/T/
)[
0
]
)
const
getDate
s
=
()
=>
{
const
date
=
new
Date
();
return
(
getDateStr
(
date
)
)
}
const
[
date
,
setDate
]
=
useState
(
getDate
())
const
[
date
,
setDate
]
=
useState
(
getDate
s
())
const
[
message
,
setMessage
]
=
useState
(
''
)
const
[
money
,
setMoney
]
=
useState
(
''
)
const
[
remained_money
,
setRemained_money
]
=
useState
(
''
)
...
...
screens/DeptForm.js
View file @
3912238f
...
...
@@ -5,6 +5,7 @@ import { Formik } from 'formik';
import
*
as
yup
from
'
yup
'
;
import
DatePicker
from
'
../components/DatePicker.js
'
;
import
InputBox
from
'
../components/InputBox
'
;
import
{
getDateStr
}
from
'
../utils/dateFunction
'
;
const
ReviewSchema
=
yup
.
object
({
date
:
yup
.
string
()
//string만 받는다
...
...
@@ -18,11 +19,11 @@ const ReviewSchema = yup.object({
.
required
()
})
const
getDate
=
()
=>
{
var
date
=
new
Date
();
return
(
String
(
date
.
toJSON
()).
split
(
/T/
)[
0
]
)
const
getDate
s
=
()
=>
{
const
date
=
new
Date
();
return
(
getDateStr
(
date
)
)
}
// const [date, setDate] = useState(getDate())
function
DeptForm
({
addInfo
})
{
return
(
...
...
@@ -45,7 +46,7 @@ function DeptForm({ addInfo }) {
<
DatePicker
inputTitle
=
'
날짜
'
date
=
{
values
.
date
||
getDate
()}
//오늘날짜 아니면 바뀐날짜
date
=
{
values
.
date
||
getDate
s
()}
//오늘날짜 아니면 바뀐날짜
setDate
=
{
handleChange
(
'
date
'
)}
/
>
<
InputBox
...
...
screens/MemoDetails.js
View file @
3912238f
...
...
@@ -5,15 +5,15 @@ import InputBox from '../components/InputBox';
import
StyledButton
from
'
../components/StyledButton
'
;
import
DatePicker
from
'
../components/DatePicker.js
'
;
import
memoApi
from
'
../db/memoPage.api
'
;
import
{
getDateStr
}
from
'
../utils/dateFunction
'
;
function
MemoDetails
({
route
,
navigation
})
{
const
{
item
,
loadMemos
}
=
route
.
params
const
getDate
=
()
=>
{
var
date
=
new
Date
();
return
(
String
(
date
.
toJSON
()).
split
(
/T/
)[
0
]
)
const
getDate
s
=
()
=>
{
const
date
=
new
Date
();
return
(
getDateStr
(
date
)
)
}
const
[
date
,
setDate
]
=
useState
(
getDate
())
const
[
date
,
setDate
]
=
useState
(
getDate
s
())
const
[
message
,
setMessage
]
=
useState
(
''
)
const
onUpdateHandle
=
async
()
=>
{
await
memoApi
.
updateMemo
({
date
,
message
},
item
.
id
)
...
...
screens/MemoForm.js
View file @
3912238f
...
...
@@ -5,20 +5,21 @@ import { Formik } from 'formik';
import
*
as
yup
from
'
yup
'
;
import
DatePicker
from
'
../components/DatePicker.js
'
;
import
InputBox
from
'
../components/InputBox.js
'
;
import
{
getDateStr
}
from
'
../utils/dateFunction
'
;
const
ReviewSchema
=
yup
.
object
({
// date: yup.string() //string만 받는다
// .required() //아무것도 입력안했하면 안받음
// , //최소4글짜
date
:
yup
.
string
()
//string만 받는다
.
required
(),
message
:
yup
.
string
()
.
required
()
.
min
(
2
),
})
const
getDate
=
()
=>
{
var
date
=
new
Date
();
return
(
String
(
date
.
toJSON
()).
split
(
/T/
)[
0
]
)
const
getDate
s
=
()
=>
{
const
date
=
new
Date
();
return
(
getDateStr
(
date
)
)
}
...
...
@@ -41,7 +42,7 @@ function MemoForm({ addInfo }) {
<
View
>
<
DatePicker
inputTitle
=
'
날짜
'
date
=
{
values
.
date
||
getDate
()}
//오늘날짜 아니면 바뀐날짜
date
=
{
values
.
date
||
getDate
s
()}
//오늘날짜 아니면 바뀐날짜
setDate
=
{
handleChange
(
'
date
'
)}
/
>
<
InputBox
...
...
utils/dateFunction.js
View file @
3912238f
export
function
getDate
(
item
)
{
export
function
getDate
Str
(
item
)
{
let
date
=
''
if
(
item
)
{
date
=
new
Date
(
item
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment