Skip to content

Commit

Permalink
Add video creation DateTimePicker in VideoForm
Browse files Browse the repository at this point in the history
  • Loading branch information
Razvan Nesiu committed Sep 11, 2019
1 parent c09c814 commit ed60040
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 ed60040

Please sign in to comment.