Skip to content

Commit

Permalink
Merge pull request #961 from ubyssey/add-video-creation-time-date-picker
Browse files Browse the repository at this point in the history
Add video creation date picker in the video form in dispatch
  • Loading branch information
razvannesiu authored Sep 11, 2019
2 parents c09c814 + ed60040 commit 21b3b19
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion dispatch/modules/content/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 10 additions & 2 deletions dispatch/static/manager/src/js/components/VideoEditor/VideoForm.js
Original file line number Diff line number Diff line change
@@ -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'

Expand Down Expand Up @@ -48,7 +48,15 @@ export default function VideoForm(props) {
value={props.listItem.tags ? props.listItem.tags: []}
update={tags => props.update('tags', tags)} />
</Form.Input>


<Form.Input
label='Created at'
error={props.errors.created_at}>
<DateTimeInput
value={props.listItem.created_at}
onChange={dt => props.update('created_at', dt)} />
</Form.Input>

{props.listItem.url &&
<div className='c-image-panel-image-page'>
<div className='c-image-panel__image'>
Expand Down

0 comments on commit 21b3b19

Please sign in to comment.