hook up date selection widget
authorGalen Charlton <gmc@equinoxinitiative.org>
Fri, 17 Jan 2020 16:35:31 +0000 (11:35 -0500)
committerGalen Charlton <gmc@equinoxinitiative.org>
Fri, 17 Jan 2020 16:35:31 +0000 (11:35 -0500)
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Open-ILS/src/eg2/src/app/staff/acq/search/acq-search.component.html
Open-ILS/src/eg2/src/app/staff/acq/search/acq-search.service.ts

index b8b7752..a9db419 100644 (file)
@@ -38,6 +38,9 @@
       [idlClass]="searchFieldLinkedClasses[t.field]"
       (onChange)="t.value1 = $event ? $event.id : ''">
     </eg-combobox>
+    <eg-date-select *ngIf="searchTermDatatypes[t.field] == 'timestamp'"
+      (onChangeAsIso)="t.value1 = $event ? $event : ''; t.is_date = true">
+    </eg-date-select>
   </div>
 </div>
 <div class="row">
index b3cd63b..4d8c380 100644 (file)
@@ -77,6 +77,7 @@ export interface AcqSearchTerm {
     op: string;
     value1: string;
     value2: string;
+    is_date?: boolean;
 }
 
 @Injectable()
@@ -110,6 +111,9 @@ export class AcqSearchService {
             if (!(recType in baseSearch)) {
                 baseSearch[recType] = [];
             }
+            if (term.is_date) {
+                searchTerm['__castdate'] = true;
+            }
             baseSearch[recType].push(searchTerm);
         });