Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
glsx-web
/
glsx-oss-task
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit f8df7209
authored
Oct 31, 2022
by
前端
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch 'xuyl_dev_v2.12.0' into 'v2.12.0'
上一个月日期处理 See merge request
!44
2 parents
54292f79
79276dfd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
src/mixin/nearlyAMonth.js
src/mixin/nearlyAMonth.js
View file @
f8df720
...
...
@@ -8,16 +8,19 @@ export const nearlyAMonth = {
created
()
{
let
date
=
new
Date
()
let
year
=
date
.
getFullYear
()
let
preYear
=
date
.
getFullYear
()
let
month
=
date
.
getMonth
()
+
1
let
day
=
date
.
getDate
()
let
aheadOfMonth
=
month
==
'1'
?
'12'
:
month
-
1
let
preDays
=
this
.
mGetDate
(
year
,
aheadOfMonth
)
// let curDays = this.mGetDate(year, month)
if
(
aheadOfMonth
==
'12'
)
{
preYear
=
preYear
-
1
}
this
.
defalutEndTime
=
year
+
'-'
+
month
+
'-'
+
day
if
(
day
>
preDays
)
{
this
.
defalutStartTime
=
y
ear
+
'-'
+
aheadOfMonth
+
'-'
+
preDays
this
.
defalutStartTime
=
preY
ear
+
'-'
+
aheadOfMonth
+
'-'
+
preDays
}
else
{
this
.
defalutStartTime
=
y
ear
+
'-'
+
aheadOfMonth
+
'-'
+
day
this
.
defalutStartTime
=
preY
ear
+
'-'
+
aheadOfMonth
+
'-'
+
day
}
},
methods
:
{
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment