调整编辑功能
This commit is contained in:
@@ -201,6 +201,20 @@ def update_task(task_id):
|
||||
data['updated_at'] = date.strftime('%Y-%m-%d %H:%M:%S')
|
||||
except ValueError:
|
||||
pass
|
||||
|
||||
if 'schedule_time' in data:
|
||||
try:
|
||||
date = datetime.strptime(data['schedule_time'], '%a, %d %b %Y %H:%M:%S GMT')
|
||||
data['schedule_time'] = date.strftime('%Y-%m-%d %H:%M:%S')
|
||||
except ValueError:
|
||||
pass
|
||||
|
||||
if 'recurring_end' in data and data['recurring_end']:
|
||||
try:
|
||||
date = datetime.strptime(data['recurring_end'], '%a, %d %b %Y %H:%M:%S GMT')
|
||||
data['recurring_end'] = date.strftime('%Y-%m-%d %H:%M:%S')
|
||||
except ValueError:
|
||||
pass
|
||||
|
||||
# 更新任务
|
||||
db.update_task(task_id, data)
|
||||
|
||||
Reference in New Issue
Block a user