Skip to content

Commit

Permalink
fixes #25
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Davies committed Jan 3, 2018
1 parent 999550e commit 816fa56
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
13 changes: 7 additions & 6 deletions carrot/templates/carrot/carrot.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Vue.component('task-detail', {
filters: {
formatDate: function(rawDate) {
// filter for converting a raw string to something more human-readable
return moment(String(rawDate)).format('DD/MM/YYYY hh:mm')
return moment(rawDate,'YYYY-MM-DD[T]hh:mm:SS').format('LLL')
},
cropped: function(data) {
console.log(this.app.$options.filters.cropped);
Expand Down Expand Up @@ -168,7 +168,7 @@ var app = new Vue({
filters: {
formatDate: function(rawDate) {
// filter for converting a raw string to something more human-readable
return moment(String(rawDate)).format('DD/MM/YYYY hh:mm')
return moment(rawDate,'YYYY-MM-DD[T]hh:mm:SS').format('LLL')
},
cropped: function(task_args) {
// crop the list of task arguments to a reasonable length
Expand Down Expand Up @@ -378,7 +378,7 @@ var app = new Vue({
getTask: function(taskId) {
// returns the data for a single task object by calling the REST API
var self = this;
return axios.get('/carrot/api/message-logs/' + taskId)
return axios.get('/carrot/api/message-logs/' + self.selectedObjectId)
.then(function (response) {
self.selectedObject = response.data;
})
Expand Down Expand Up @@ -422,6 +422,7 @@ var app = new Vue({
)
.then(function (response) {
console.log(response)

self.getFailedMessageLogs()
self.getPublishedMessageLogs()
})
Expand Down Expand Up @@ -490,8 +491,8 @@ var app = new Vue({
console.log(task);
var self = this;
this.formErrors = {};
if (task.id) {
return axios.patch('/carrot/api/scheduled-tasks/' + task.id + '/', task, {
if (task.pk) {
return axios.patch('/carrot/api/scheduled-tasks/' + task.pk + '/', task, {
headers: {
'X-CSRFToken': '{{ csrf_token }}'
}
Expand Down Expand Up @@ -591,7 +592,7 @@ app.$watch('scheduledPage', function (newVal, oldVal) {
// watcher that calls app.getTask() whenever there is a change to the selected object pk, and that pk is not null
app.$watch('selectedObjectId', function (newVal, oldVal) {
if (newVal) {
app.getTask(newVal);
app.getTask();
}
})

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def readme():

setup(
name='django-carrot',
version='0.4.3',
version='0.4.4',
packages=find_packages(),
include_package_data=True,
license='Apache Software License',
Expand Down

0 comments on commit 816fa56

Please sign in to comment.