Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jinfa-admin
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
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
project
jinfa-admin
Commits
86bba4b5
Commit
86bba4b5
authored
Jan 15, 2021
by
GuanHua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
merge: 解决冲突
parent
f2e43214
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
63 deletions
+1
-63
index.ts
src/utils/index.ts
+1
-63
No files found.
src/utils/index.ts
View file @
86bba4b5
...
...
@@ -30,7 +30,7 @@ export const findLastIndexFlowState = (data: any[], customKey = 'isExecute'): nu
return
index
;
};
export
function
formatTimeString
(
date
,
format
:
string
=
'YYYY-MM-DD HH:mm:ss'
)
{
export
function
formatTimeString
(
date
,
format
=
'YYYY-MM-DD HH:mm:ss'
)
{
return
date
?
moment
(
date
).
format
(
format
)
:
''
}
...
...
@@ -59,138 +59,76 @@ export function timeRange(val: number) {
moment
()
.
startOf
(
'days'
)
.
format
(
'YYYY-MM-DD HH:mm:ss'
),
<<<<<<<
HEAD
).
unix
();
=======
).
valueOf
();
>>>>>>>
ef47bc8c1f81b198b10dc626fab6a6f54ad62fd5
et
=
moment
(
moment
()
.
endOf
(
'days'
)
.
format
(
'YYYY-MM-DD HH:mm:ss'
),
<<<<<<<
HEAD
).
unix
();
=======
).
valueOf
();
>>>>>>>
ef47bc8c1f81b198b10dc626fab6a6f54ad62fd5
break
;
case
2
:
st
=
moment
(
moment
()
.
subtract
(
7
,
'days'
)
.
format
(
'YYYY-MM-DD'
)
+
' 00:00:00'
,
<<<<<<<
HEAD
).
unix
();
=======
).
valueOf
();
>>>>>>>
ef47bc8c1f81b198b10dc626fab6a6f54ad62fd5
et
=
moment
(
moment
()
.
endOf
(
'days'
)
.
format
(
'YYYY-MM-DD HH:mm:ss'
),
<<<<<<<
HEAD
).
unix
();
=======
).
valueOf
();
>>>>>>>
ef47bc8c1f81b198b10dc626fab6a6f54ad62fd5
break
;
case
3
:
st
=
moment
(
moment
()
.
subtract
(
29
,
'days'
)
.
format
(
'YYYY-MM-DD'
)
+
' 00:00:00'
,
<<<<<<<
HEAD
).
unix
();
=======
).
valueOf
();
>>>>>>>
ef47bc8c1f81b198b10dc626fab6a6f54ad62fd5
et
=
moment
(
moment
()
.
endOf
(
'days'
)
.
format
(
'YYYY-MM-DD HH:mm:ss'
),
<<<<<<<
HEAD
).
unix
();
=======
).
valueOf
();
>>>>>>>
ef47bc8c1f81b198b10dc626fab6a6f54ad62fd5
break
;
case
4
:
st
=
moment
(
moment
()
.
subtract
(
89
,
'days'
)
.
format
(
'YYYY-MM-DD'
)
+
' 00:00:00'
,
<<<<<<<
HEAD
).
unix
();
=======
).
valueOf
();
>>>>>>>
ef47bc8c1f81b198b10dc626fab6a6f54ad62fd5
et
=
moment
(
moment
()
.
endOf
(
'days'
)
.
format
(
'YYYY-MM-DD HH:mm:ss'
),
<<<<<<<
HEAD
).
unix
();
=======
).
valueOf
();
>>>>>>>
ef47bc8c1f81b198b10dc626fab6a6f54ad62fd5
break
;
case
5
:
st
=
moment
(
moment
()
.
subtract
(
179
,
'days'
)
.
format
(
'YYYY-MM-DD'
)
+
' 00:00:00'
,
<<<<<<<
HEAD
).
unix
();
=======
).
valueOf
();
>>>>>>>
ef47bc8c1f81b198b10dc626fab6a6f54ad62fd5
et
=
moment
(
moment
()
.
endOf
(
'days'
)
.
format
(
'YYYY-MM-DD HH:mm:ss'
),
<<<<<<<
HEAD
).
unix
();
=======
).
valueOf
();
>>>>>>>
ef47bc8c1f81b198b10dc626fab6a6f54ad62fd5
break
;
case
6
:
st
=
moment
(
moment
()
.
subtract
(
364
,
'days'
)
.
format
(
'YYYY-MM-DD'
)
+
' 00:00:00'
,
<<<<<<<
HEAD
).
unix
();
=======
).
valueOf
();
>>>>>>>
ef47bc8c1f81b198b10dc626fab6a6f54ad62fd5
et
=
moment
(
moment
()
.
endOf
(
'days'
)
.
format
(
'YYYY-MM-DD HH:mm:ss'
),
<<<<<<<
HEAD
).
unix
();
break
;
case
7
:
st
=
moment
(
moment
()
.
year
(
moment
().
year
()
-
1
)
.
startOf
(
'year'
)
.
format
(
'YYYY-MM-DD HH:mm:ss'
),
).
unix
();
et
=
moment
(
moment
()
.
year
(
moment
().
year
()
-
1
)
.
endOf
(
'year'
)
.
format
(
'YYYY-MM-DD HH:mm:ss'
),
).
unix
();
=======
).
valueOf
();
break
;
case
7
:
st
=
moment
(
'1971-01-01'
,
'YYYY-MM-DD'
).
valueOf
();
// 或者0
et
=
moment
().
subtract
(
1
,
"year"
).
valueOf
();
>>>>>>>
ef47bc8c1f81b198b10dc626fab6a6f54ad62fd5
break
;
}
return
{
st
,
et
}
...
...
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