From ed6004060c21620a1e43d73d8b89f3cfcda05052 Mon Sep 17 00:00:00 2001 From: Razvan Nesiu Date: Wed, 11 Sep 2019 13:41:46 -0700 Subject: [PATCH] Add video creation DateTimePicker in VideoForm --- dispatch/modules/content/models.py | 2 +- .../src/js/components/VideoEditor/VideoForm.js | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/dispatch/modules/content/models.py b/dispatch/modules/content/models.py index b110cb429..11b26edbf 100644 --- a/dispatch/modules/content/models.py +++ b/dispatch/modules/content/models.py @@ -459,7 +459,7 @@ class Video(Model, AuthorMixin): authors = ManyToManyField(Author, related_name='video_authors') tags = ManyToManyField('Tag') - created_at = DateTimeField(auto_now_add=True) + created_at = DateTimeField(default=timezone.now) updated_at = DateTimeField(auto_now=True) AuthorModel = Author diff --git a/dispatch/static/manager/src/js/components/VideoEditor/VideoForm.js b/dispatch/static/manager/src/js/components/VideoEditor/VideoForm.js index 06f9ce2ce..cd68f17a5 100644 --- a/dispatch/static/manager/src/js/components/VideoEditor/VideoForm.js +++ b/dispatch/static/manager/src/js/components/VideoEditor/VideoForm.js @@ -1,6 +1,6 @@ import React from 'react' -import { TextInput } from '../inputs' +import { TextInput, DateTimeInput } from '../inputs' import AuthorSelectInput from '../inputs/selects/AuthorSelectInput' import TagSelectInput from '../inputs/selects/TagSelectInput' @@ -48,7 +48,15 @@ export default function VideoForm(props) { value={props.listItem.tags ? props.listItem.tags: []} update={tags => props.update('tags', tags)} /> - + + + props.update('created_at', dt)} /> + + {props.listItem.url &&