when adding annotation, populate date property (fixes #450)

This commit is contained in:
rolux 2012-02-15 21:29:12 +00:00
parent 86beba3039
commit ed150bb5e1

View file

@ -286,14 +286,17 @@ pandora.ui.item = function() {
Ox.Log('', 'addAnnotation', data); Ox.Log('', 'addAnnotation', data);
// async to not capture keyboard input // async to not capture keyboard input
setTimeout(function() { setTimeout(function() {
var now = Ox.formatDate(Date(), '%Y-%m-%dT%H:%M:%SZ'); var d = new Date(),
created = Ox.formatDate(d, '%Y-%m-%dT%H:%M:%SZ'),
date = Ox.formatDate(d, '%B %e, %Y');
pandora.$ui.editor.addAnnotation(data.layer, Ox.extend({ pandora.$ui.editor.addAnnotation(data.layer, Ox.extend({
created: now, created: created,
date: date,
duration: data.out - data['in'], duration: data.out - data['in'],
editable: true, editable: true,
id: '_' + Ox.uid(), id: '_' + Ox.uid(),
'in': data['in'], 'in': data['in'],
modified: now, modified: created,
out: data.out, out: data.out,
user: pandora.user.username, user: pandora.user.username,
value: '', value: '',