Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
I
InvestCustomer
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Giang Tran
InvestCustomer
Commits
50e3b252
Commit
50e3b252
authored
May 27, 2021
by
Giang Tran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update color calendar
parent
7cfd9ca1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
56 additions
and
18 deletions
+56
-18
Functions.js
src/Config/Functions.js
+14
-6
Calendar.js
src/Screens/NewFeed/Calendar/Calendar.js
+0
-2
item.js
src/Screens/NewFeed/Calendar/item.js
+42
-10
No files found.
src/Config/Functions.js
View file @
50e3b252
...
...
@@ -236,14 +236,18 @@ export const toPriceVnd = (str) => {
export
const
floatToPriceVnd
=
(
str
)
=>
{
if
(
str
)
{
let
stringPrice
=
str
.
toString
().
split
(
'.'
)
let
headStringPrice
=
`
${
stringPrice
[
0
].
replace
(
/
(\d)(?=(\d{3})
+
(?!\d))
/g
,
'$1,'
)}
`
return
stringPrice
.
length
===
1
?
headStringPrice
:
headStringPrice
.
concat
(
`.
${
stringPrice
[
1
]}
`
)
let
stringPrice
=
str
.
toString
().
split
(
'.'
);
let
headStringPrice
=
`
${
stringPrice
[
0
].
replace
(
/
(\d)(?=(\d{3})
+
(?!\d))
/g
,
'$1,'
,
)}
`
;
return
stringPrice
.
length
===
1
?
headStringPrice
:
headStringPrice
.
concat
(
`.
${
stringPrice
[
1
]}
`
);
}
else
{
return
''
return
''
;
}
}
}
;
// cắt chuỗi dạng something...
export
const
ellipsis
=
(
str
=
''
,
max
=
30
)
=>
...
...
@@ -408,6 +412,10 @@ export const convertDate = (date) => {
return
time
;
};
export
const
getDate
=
(
date
)
=>
{
return
moment
(
date
).
get
(
'date'
);
};
export
const
convertTime
=
(
date
)
=>
{
const
temp
=
new
Date
(
moment
(
date
,
'DD/MM/YYYY'
));
const
time
=
moment
(
temp
).
format
(
'YYYY-MM-DD'
);
...
...
src/Screens/NewFeed/Calendar/Calendar.js
View file @
50e3b252
...
...
@@ -69,8 +69,6 @@ const NewFeed = (props) => {
style
=
{{
flex
:
1
,
backgroundColor
:
'white'
,
paddingLeft
:
10
,
paddingRight
:
20
,
paddingTop
:
10
,
}}
>
<
FlatList
...
...
src/Screens/NewFeed/Calendar/item.js
View file @
50e3b252
...
...
@@ -2,19 +2,50 @@ import React, {Component} from 'react';
import
{
View
,
Text
,
StyleSheet
}
from
'react-native'
;
import
R
from
'../../../assets/R'
;
import
Block
from
'../../../components/Block'
;
import
{
getFontXD
}
from
'../../../Config/Functions'
;
import
{
convertDate
}
from
'../../../Config/Functions'
;
import
{
getFontXD
,
convertDate
}
from
'../../../Config/Functions'
;
const
Item
=
(
props
)
=>
{
const
{
title
,
date
,
time
,
start_date
}
=
props
.
item
;
const
d
=
new
Date
();
return
(
<
View
style
=
{
styles
.
container
}
>
<
View
style
=
{[
styles
.
container
,
d
.
getDate
()
==
convertDate
(
start_date
).
slice
(
0
,
2
)
?
{
backgroundColor
:
'#B4D5FF'
}
:
{},
]}
>
<
View
style
=
{
styles
.
left
}
>
<
View
style
=
{
styles
.
dot
}
/
>
<
View
style
=
{[
styles
.
dot
,
d
.
getDate
()
==
convertDate
(
start_date
).
slice
(
0
,
2
)
?
{
backgroundColor
:
'red'
}
:
{},
]}
/
>
<
/View
>
<
View
style
=
{[
styles
.
right
,
props
.
index
==
0
?
{
borderTopWidth
:
0
}
:
{}]}
>
<
View
style
=
{
styles
.
row
}
>
<
Text
style
=
{
styles
.
txtTime
}
>
{
convertDate
(
start_date
)}
<
/Text
>
<
Text
style
=
{
styles
.
txtDate
}
>
{
start_date
.
substring
(
10
,
16
)}
<
/Text
>
<
Text
style
=
{[
styles
.
txtTime
,
d
.
getDate
()
==
convertDate
(
start_date
).
slice
(
0
,
2
)
?
{
color
:
'red'
,
fontWeight
:
'500'
}
:
{},
]}
>
{
' '
}
{
convertDate
(
start_date
)}
<
/Text
>
<
Text
style
=
{[
styles
.
txtDate
,
d
.
getDate
()
==
convertDate
(
start_date
).
slice
(
0
,
2
)
?
{
color
:
'red'
,
fontWeight
:
'500'
}
:
{},
]}
>
{
start_date
.
substring
(
10
,
16
)}
<
/Text
>
<
/View
>
<
Text
style
=
{
styles
.
txtTitle
}
>
{
title
}
<
/Text
>
<
/View
>
...
...
@@ -27,11 +58,12 @@ export default Item;
const
styles
=
StyleSheet
.
create
({
container
:
{
flexDirection
:
'row'
,
marginLeft
:
10
,
paddingLeft
:
20
,
paddingRight
:
20
,
},
left
:
{
width
:
0.6
,
backgroundColor
:
'#
CECECE
'
,
width
:
1
,
backgroundColor
:
'#
A7A7A7
'
,
},
right
:
{
marginLeft
:
20
,
...
...
@@ -62,6 +94,6 @@ const styles = StyleSheet.create({
color
:
R
.
colors
.
main
,
},
txtDate
:
{
color
:
'#
929292
'
,
color
:
'#
A7A7A7
'
,
},
});
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