From ba12392287dcc22d19818486c9fa4d5d9686fe9b Mon Sep 17 00:00:00 2001 From: astex <0astex@gmail.com> Date: Mon, 2 May 2016 12:26:04 -0400 Subject: [PATCH 1/4] Add moment dependency. --- front/package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/front/package.json b/front/package.json index 9129149..f502417 100644 --- a/front/package.json +++ b/front/package.json @@ -17,6 +17,7 @@ "es6-promise": "^3.0.2", "es6-shim": "^0.33.3", "googleapis": "^5.0.0", + "moment": "^2.13.0", "node-sass": "^3.4.2", "reflect-metadata": "0.1.2", "rxjs": "5.0.0-beta.2", -- GitLab From ae808ea9bd83b3930736843c61fda8337b27e2ea Mon Sep 17 00:00:00 2001 From: astex <0astex@gmail.com> Date: Mon, 2 May 2016 12:26:24 -0400 Subject: [PATCH 2/4] Add moment to the project slot context. --- front/current/components/project/slot.component.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/front/current/components/project/slot.component.ts b/front/current/components/project/slot.component.ts index 8e1f745..13c8c32 100644 --- a/front/current/components/project/slot.component.ts +++ b/front/current/components/project/slot.component.ts @@ -4,6 +4,9 @@ import { Model, Collection } from '../../services/rest.service'; import { NewDocumentSlotComponent } from './new-document-slot.component'; +declare var moment:any; + + @Component({ selector: 'document-slot', templateUrl: config.static_url + '/components/project/slot.component.html', @@ -20,6 +23,8 @@ export class SlotComponent { parent_documents:Collection; parent_document_slots:Collection; + moment = moment; + public download(document_:Model) { document_.setFilters({verbosity: 'data'}).fetch(() => { var link = document.createElement('a'); -- GitLab From cb700546403b9e4ad0d32ee85bfc6337f7f9784c Mon Sep 17 00:00:00 2001 From: astex <0astex@gmail.com> Date: Mon, 2 May 2016 12:26:44 -0400 Subject: [PATCH 3/4] Include moment.js. --- front/index.default.html | 2 ++ 1 file changed, 2 insertions(+) diff --git a/front/index.default.html b/front/index.default.html index 9280e52..87d4b5e 100644 --- a/front/index.default.html +++ b/front/index.default.html @@ -21,6 +21,8 @@ + + -- GitLab From c548f44615b76995c7540c8afafb8d2ff5900bf0 Mon Sep 17 00:00:00 2001 From: astex <0astex@gmail.com> Date: Mon, 2 May 2016 12:26:54 -0400 Subject: [PATCH 4/4] Display datetimes using moment.js. --- front/current/components/project/slot.component.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/front/current/components/project/slot.component.html b/front/current/components/project/slot.component.html index 5fe5155..4bd8999 100644 --- a/front/current/components/project/slot.component.html +++ b/front/current/components/project/slot.component.html @@ -7,7 +7,7 @@ (click)="download(document)" *ngIf="!document.loading" >{{ document.data['name'] }} - {{ document.data['created'] }} -- GitLab