Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
bdc
/
bdcjg-web
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
bddcf056
authored
2023-02-07 17:12:49 +0800
by
yangwei
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
时间处理公共方法
1 parent
f2804a5b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
0 deletions
src/utils/operation.js
src/utils/operation.js
View file @
bddcf05
...
...
@@ -109,4 +109,29 @@ export function down (index, data) {
data
.
splice
(
index
+
1
,
1
);
data
.
splice
(
index
,
0
,
downData
);
}
}
export
function
timeFormat
(
date
)
{
if
(
!
date
||
typeof
(
date
)
===
"string"
)
{
this
.
error
(
"参数异常,请检查..."
);
}
var
y
=
date
.
getFullYear
();
//年
var
m
=
date
.
getMonth
()
+
1
;
//月
var
d
=
date
.
getDate
();
//日
return
y
+
"/"
+
m
+
"/"
+
d
+
' 00:00:00'
;
}
export
function
getFirstDayOfSeason
(
d
)
{
let
date
=
d
||
new
Date
()
var
month
=
date
.
getMonth
();
if
(
month
<
3
){
date
.
setMonth
(
0
);
}
else
if
(
2
<
month
&&
month
<
6
){
date
.
setMonth
(
3
);
}
else
if
(
5
<
month
&&
month
<
9
){
date
.
setMonth
(
6
);
}
else
if
(
8
<
month
&&
month
<
11
){
date
.
setMonth
(
9
);
}
date
.
setDate
(
1
);
return
timeFormat
(
date
);
}
\ No newline at end of file
...
...
Please
register
or
sign in
to post a comment