Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
haoban-3
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
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
office
haoban-3
Commits
1906d72d
Commit
1906d72d
authored
Aug 02, 2021
by
caoyanzhi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修复农历显示异常的bug
parent
80ec8766
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
index.vue
src/views/index/index.vue
+3
-2
No files found.
src/views/index/index.vue
View file @
1906d72d
...
@@ -223,7 +223,8 @@ export default {
...
@@ -223,7 +223,8 @@ export default {
// date格式为 "2021年六月24 下午4:59:02"
// date格式为 "2021年六月24 下午4:59:02"
const
now
=
new
Date
().
toLocaleString
(
'zh-Hans-u-ca-chinese'
);
const
now
=
new
Date
().
toLocaleString
(
'zh-Hans-u-ca-chinese'
);
// 解析date得到 六月廿四 的农历格式
// 解析date得到 六月廿四 的农历格式
const
month
=
now
.
match
(
/年
(
.*
)
月/
)[
1
];
let
month
=
now
.
match
(
/年
(
.*
)
月/
)[
1
];
month
=
month
==
'十一'
?
'冬'
:
month
;
let
date
=
now
.
match
(
/月
(\d
*
)\s
/
)[
1
];
let
date
=
now
.
match
(
/月
(\d
*
)\s
/
)[
1
];
if
(
Number
(
date
)
<=
10
)
{
if
(
Number
(
date
)
<=
10
)
{
// 初几
// 初几
...
@@ -233,7 +234,7 @@ export default {
...
@@ -233,7 +234,7 @@ export default {
// 二十几 三十
// 二十几 三十
date
=
date
[
1
]
==
0
?
`
${
ones
.
charAt
(
date
[
0
]
-
1
)}
十`
:
`
${
tens
.
charAt
(
date
[
0
]
-
1
)}${
ones
.
charAt
(
date
[
1
]
-
1
)}
`
;
date
=
date
[
1
]
==
0
?
`
${
ones
.
charAt
(
date
[
0
]
-
1
)}
十`
:
`
${
tens
.
charAt
(
date
[
0
]
-
1
)}${
ones
.
charAt
(
date
[
1
]
-
1
)}
`
;
}
}
return
`
${
month
}${
date
}
`
;
return
`
${
month
}
月
${
date
}
`
;
},
},
/**
/**
* 帮助中心跳转
* 帮助中心跳转
...
...
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