Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yohobuywap-node
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
ccbikai
9 years ago
Commit
33f7e71157416b29fdbb7b731ba341368c69fa3f
1 parent
1c8c55cf
专题活动倒计时支持年
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletions
utils/time-process.js
utils/time-process.js
View file @
33f7e71
...
...
@@ -7,6 +7,7 @@
const
helpers
=
global
.
yoho
.
helpers
;
const
timeFormat
=
{
y
:
'剩{y}年{d}天'
,
d
:
'剩{d}天'
,
h
:
'剩{h}小时'
,
m
:
'剩{m}分钟'
,
...
...
@@ -18,6 +19,7 @@ const timeFormat = {
};
const
anHour
=
3600
;
const
aYear
=
31536000
;
const
aDay
=
anHour
*
24
;
/**
...
...
@@ -33,7 +35,9 @@ const processTime = (time) => {
data
.
warnColor
=
true
;
data
.
time
=
'低于1小时'
;
}
else
{
if
(
time
>
aDay
)
{
if
(
time
>
aYear
)
{
type
=
'y'
;
}
else
if
(
time
>
aDay
)
{
type
=
'dh'
;
}
else
{
type
=
'h'
;
...
...
Please
register
or
login
to post a comment