api format, css, auth errors
This commit is contained in:
@@ -26,6 +26,14 @@ class Item {
|
||||
|
||||
_.merge(this, json_obj);
|
||||
|
||||
if(this.created_at) {
|
||||
this.created_at = new Date(this.created_at);
|
||||
this.updated_at = new Date(this.updated_at);
|
||||
} else {
|
||||
this.created_at = new Date();
|
||||
this.updated_at = new Date();
|
||||
}
|
||||
|
||||
if(!this.uuid) {
|
||||
this.uuid = Neeto.crypto.generateUUID();
|
||||
}
|
||||
@@ -43,6 +51,12 @@ class Item {
|
||||
}
|
||||
}
|
||||
|
||||
static sortItemsByDate(items) {
|
||||
items.sort(function(a,b){
|
||||
return new Date(b.created_at) - new Date(a.created_at);
|
||||
});
|
||||
}
|
||||
|
||||
addReference(reference) {
|
||||
this.content.references.push(reference);
|
||||
this.content.references = _.uniq(this.content.references);
|
||||
|
||||
Reference in New Issue
Block a user