[open-ils-commits] [GIT] Evergreen ILS branch master updated. 9b294be6a8280609781729ecbfb85f90ae9469f7
Evergreen Git
git at git.evergreen-ils.org
Fri Jan 18 10:17:49 EST 2019
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".
The branch, master has been updated
via 9b294be6a8280609781729ecbfb85f90ae9469f7 (commit)
from 55a0e12ba71e496b0c0ee72c9567e610be42bfdc (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 9b294be6a8280609781729ecbfb85f90ae9469f7
Author: Bill Erickson <berickxx at gmail.com>
Date: Tue Dec 18 10:50:26 2018 -0500
LP1807764 Angular grid gets datePlusTime option
Adds a new boolean datePlusTime option to the Angular grid column
configuration, informing the grid to display both date and time in the
cell for a datetype=timestamp column.
Includes sandbox example.
Signed-off-by: Bill Erickson <berickxx at gmail.com>
Signed-off-by: Jane Sandberg <sandbej at linnbenton.edu>
diff --git a/Open-ILS/src/eg2/src/app/share/grid/grid-column.component.ts b/Open-ILS/src/eg2/src/app/share/grid/grid-column.component.ts
index dffede1..4cebd48 100644
--- a/Open-ILS/src/eg2/src/app/share/grid/grid-column.component.ts
+++ b/Open-ILS/src/eg2/src/app/share/grid/grid-column.component.ts
@@ -24,6 +24,9 @@ export class GridColumnComponent implements OnInit {
@Input() datatype: string;
@Input() multiSortable: boolean;
+ // Display date and time when datatype = timestamp
+ @Input() datePlusTime: boolean;
+
// Used in conjunction with cellTemplate
@Input() cellContext: any;
@Input() cellTemplate: TemplateRef<any>;
@@ -50,6 +53,7 @@ export class GridColumnComponent implements OnInit {
col.isSortable = this.sortable;
col.isMultiSortable = this.multiSortable;
col.datatype = this.datatype;
+ col.datePlusTime = this.datePlusTime;
col.isAuto = false;
this.grid.context.columnSet.add(col);
}
diff --git a/Open-ILS/src/eg2/src/app/share/grid/grid.ts b/Open-ILS/src/eg2/src/app/share/grid/grid.ts
index e04940d..a352c0c 100644
--- a/Open-ILS/src/eg2/src/app/share/grid/grid.ts
+++ b/Open-ILS/src/eg2/src/app/share/grid/grid.ts
@@ -24,6 +24,7 @@ export class GridColumn {
idlClass: string;
idlFieldDef: any;
datatype: string;
+ datePlusTime: boolean;
cellTemplate: TemplateRef<any>;
cellContext: any;
isIndex: boolean;
@@ -630,7 +631,12 @@ export class GridContext {
val = this.nestedItemFieldValue(row, col);
}
}
- return this.format.transform({value: val, datatype: col.datatype});
+
+ return this.format.transform({
+ value: val,
+ datatype: col.datatype,
+ datePlusTime: Boolean(col.datePlusTime)
+ });
}
getObjectFieldValue(obj: any, name: string): any {
diff --git a/Open-ILS/src/eg2/src/app/staff/sandbox/sandbox.component.html b/Open-ILS/src/eg2/src/app/staff/sandbox/sandbox.component.html
index 289ed50..cd003ff 100644
--- a/Open-ILS/src/eg2/src/app/staff/sandbox/sandbox.component.html
+++ b/Open-ILS/src/eg2/src/app/staff/sandbox/sandbox.component.html
@@ -126,6 +126,8 @@ HERasdfE
[cellContext]="btGridTestContext" [sortable]="false">
</eg-grid-column>
<eg-grid-column [sortable]="false" path="owner.name"></eg-grid-column>
+ <eg-grid-column [sortable]="false" path="datetime_test"
+ datatype="timestamp" [datePlusTime]="true"></eg-grid-column>
</eg-grid>
<br/><br/>
diff --git a/Open-ILS/src/eg2/src/app/staff/sandbox/sandbox.component.ts b/Open-ILS/src/eg2/src/app/staff/sandbox/sandbox.component.ts
index 92b18dc..6178969 100644
--- a/Open-ILS/src/eg2/src/app/staff/sandbox/sandbox.component.ts
+++ b/Open-ILS/src/eg2/src/app/staff/sandbox/sandbox.component.ts
@@ -103,6 +103,7 @@ export class SandboxComponent implements OnInit {
}).pipe(map(cbt => {
// example of inline fleshing
cbt.owner(this.org.get(cbt.owner()));
+ cbt.datetime_test = new Date();
this.oneBtype = cbt;
return cbt;
}));
-----------------------------------------------------------------------
Summary of changes:
.../src/app/share/grid/grid-column.component.ts | 4 ++++
Open-ILS/src/eg2/src/app/share/grid/grid.ts | 8 +++++++-
.../src/app/staff/sandbox/sandbox.component.html | 2 ++
.../eg2/src/app/staff/sandbox/sandbox.component.ts | 1 +
4 files changed, 14 insertions(+), 1 deletions(-)
hooks/post-receive
--
Evergreen ILS
More information about the open-ils-commits
mailing list