Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
V
vest
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
2
Merge Requests
2
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
rank
vest
Commits
acea2601
Commit
acea2601
authored
Dec 26, 2019
by
lixiaofang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改bug
parent
b86c40fb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
process_time.py
moment/views/process_time.py
+6
-4
No files found.
moment/views/process_time.py
View file @
acea2601
...
...
@@ -91,9 +91,10 @@ def get_one_six_days_random_time(frmt='%Y-%m-%d %H:%M:%S', num_days=0, action_ty
return
[]
def
get_ten_last_days_random_time
(
num_days
=
None
,
frmt
=
'
%
Y-
%
m-
%
d
%
H:
%
M:
%
S'
,
action_type
=
None
,
content_level
=
0
,
content_day_need_add_one_day
=
False
):
def
get_ten_last_days_random_time
(
num_days
=
None
,
frmt
=
'
%
Y-
%
m-
%
d
%
H:
%
M:
%
S'
,
content_level
=
0
,
content_day_need_add_one_day
=
False
,
action_type
=
None
):
try
:
if
num_days
==
None
:
return
[]
##比较当前时间和最后一次创建时间的差
...
...
@@ -153,7 +154,7 @@ def get_content_time_by_create_time(create_time="", content_level=0, action_type
# nowt = now.strftime('%Y-%m-%d %H:%M:%S')
##获取创建时间和当前时间的相差秒数
# num = (now - createt).total_seconds()
num_days
=
now
.
day
-
createt
.
day
num_days
=
(
now
-
createt
)
.
days
content_day_need_add_one_day
=
False
if
after_day
==
True
and
card_info
is
not
None
:
num_days
+=
repeat_time
...
...
@@ -176,7 +177,8 @@ def get_content_time_by_create_time(create_time="", content_level=0, action_type
elif
num_days
>
6
and
num_days
<=
365
:
get_time
=
get_ten_last_days_random_time
(
num_days
=
num_days
,
content_level
=
content_level
,
content_day_need_add_one_day
=
content_day_need_add_one_day
)
content_day_need_add_one_day
=
content_day_need_add_one_day
,
action_type
=
action_type
)
time_region
=
2
return
get_time
,
time_region
...
...
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