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
Show 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) => {
...
@@ -236,14 +236,18 @@ export const toPriceVnd = (str) => {
export
const
floatToPriceVnd
=
(
str
)
=>
{
export
const
floatToPriceVnd
=
(
str
)
=>
{
if
(
str
)
{
if
(
str
)
{
let
stringPrice
=
str
.
toString
().
split
(
'.'
)
let
stringPrice
=
str
.
toString
().
split
(
'.'
);
let
headStringPrice
=
`
${
stringPrice
[
0
].
replace
(
/
(\d)(?=(\d{3})
+
(?!\d))
/g
,
'$1,'
)}
`
let
headStringPrice
=
`
${
stringPrice
[
0
].
replace
(
return
stringPrice
.
length
===
1
?
headStringPrice
:
headStringPrice
.
concat
(
`.
${
stringPrice
[
1
]}
`
)
/
(\d)(?=(\d{3})
+
(?!\d))
/g
,
'$1,'
,
)}
`
;
return
stringPrice
.
length
===
1
?
headStringPrice
:
headStringPrice
.
concat
(
`.
${
stringPrice
[
1
]}
`
);
}
else
{
}
else
{
return
''
return
''
;
}
}
}
}
;
// cắt chuỗi dạng something...
// cắt chuỗi dạng something...
export
const
ellipsis
=
(
str
=
''
,
max
=
30
)
=>
export
const
ellipsis
=
(
str
=
''
,
max
=
30
)
=>
...
@@ -408,6 +412,10 @@ export const convertDate = (date) => {
...
@@ -408,6 +412,10 @@ export const convertDate = (date) => {
return
time
;
return
time
;
};
};
export
const
getDate
=
(
date
)
=>
{
return
moment
(
date
).
get
(
'date'
);
};
export
const
convertTime
=
(
date
)
=>
{
export
const
convertTime
=
(
date
)
=>
{
const
temp
=
new
Date
(
moment
(
date
,
'DD/MM/YYYY'
));
const
temp
=
new
Date
(
moment
(
date
,
'DD/MM/YYYY'
));
const
time
=
moment
(
temp
).
format
(
'YYYY-MM-DD'
);
const
time
=
moment
(
temp
).
format
(
'YYYY-MM-DD'
);
...
...
src/Screens/NewFeed/Calendar/Calendar.js
View file @
50e3b252
...
@@ -69,8 +69,6 @@ const NewFeed = (props) => {
...
@@ -69,8 +69,6 @@ const NewFeed = (props) => {
style
=
{{
style
=
{{
flex
:
1
,
flex
:
1
,
backgroundColor
:
'white'
,
backgroundColor
:
'white'
,
paddingLeft
:
10
,
paddingRight
:
20
,
paddingTop
:
10
,
paddingTop
:
10
,
}}
>
}}
>
<
FlatList
<
FlatList
...
...
src/Screens/NewFeed/Calendar/item.js
View file @
50e3b252
...
@@ -2,19 +2,50 @@ import React, {Component} from 'react';
...
@@ -2,19 +2,50 @@ import React, {Component} from 'react';
import
{
View
,
Text
,
StyleSheet
}
from
'react-native'
;
import
{
View
,
Text
,
StyleSheet
}
from
'react-native'
;
import
R
from
'../../../assets/R'
;
import
R
from
'../../../assets/R'
;
import
Block
from
'../../../components/Block'
;
import
Block
from
'../../../components/Block'
;
import
{
getFontXD
}
from
'../../../Config/Functions'
;
import
{
getFontXD
,
convertDate
}
from
'../../../Config/Functions'
;
import
{
convertDate
}
from
'../../../Config/Functions'
;
const
Item
=
(
props
)
=>
{
const
Item
=
(
props
)
=>
{
const
{
title
,
date
,
time
,
start_date
}
=
props
.
item
;
const
{
title
,
date
,
time
,
start_date
}
=
props
.
item
;
const
d
=
new
Date
();
return
(
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
.
left
}
>
<
View
style
=
{
styles
.
dot
}
/
>
<
View
style
=
{[
styles
.
dot
,
d
.
getDate
()
==
convertDate
(
start_date
).
slice
(
0
,
2
)
?
{
backgroundColor
:
'red'
}
:
{},
]}
/
>
<
/View
>
<
/View
>
<
View
style
=
{[
styles
.
right
,
props
.
index
==
0
?
{
borderTopWidth
:
0
}
:
{}]}
>
<
View
style
=
{[
styles
.
right
,
props
.
index
==
0
?
{
borderTopWidth
:
0
}
:
{}]}
>
<
View
style
=
{
styles
.
row
}
>
<
View
style
=
{
styles
.
row
}
>
<
Text
style
=
{
styles
.
txtTime
}
>
{
convertDate
(
start_date
)}
<
/Text
>
<
Text
<
Text
style
=
{
styles
.
txtDate
}
>
{
start_date
.
substring
(
10
,
16
)}
<
/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
>
<
/View
>
<
Text
style
=
{
styles
.
txtTitle
}
>
{
title
}
<
/Text
>
<
Text
style
=
{
styles
.
txtTitle
}
>
{
title
}
<
/Text
>
<
/View
>
<
/View
>
...
@@ -27,11 +58,12 @@ export default Item;
...
@@ -27,11 +58,12 @@ export default Item;
const
styles
=
StyleSheet
.
create
({
const
styles
=
StyleSheet
.
create
({
container
:
{
container
:
{
flexDirection
:
'row'
,
flexDirection
:
'row'
,
marginLeft
:
10
,
paddingLeft
:
20
,
paddingRight
:
20
,
},
},
left
:
{
left
:
{
width
:
0.6
,
width
:
1
,
backgroundColor
:
'#
CECECE
'
,
backgroundColor
:
'#
A7A7A7
'
,
},
},
right
:
{
right
:
{
marginLeft
:
20
,
marginLeft
:
20
,
...
@@ -62,6 +94,6 @@ const styles = StyleSheet.create({
...
@@ -62,6 +94,6 @@ const styles = StyleSheet.create({
color
:
R
.
colors
.
main
,
color
:
R
.
colors
.
main
,
},
},
txtDate
:
{
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