LP1904036 Message
authorBill Erickson <berickxx@gmail.com>
Thu, 1 Apr 2021 22:01:44 +0000 (18:01 -0400)
committerBill Erickson <berickxx@gmail.com>
Mon, 5 Apr 2021 14:19:31 +0000 (10:19 -0400)
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Open-ILS/src/eg2/src/app/share/util/date.ts
Open-ILS/src/eg2/src/app/staff/circ/patron/patron.component.html
Open-ILS/src/eg2/src/app/staff/circ/patron/patron.module.ts

index 23ce881..3a5c9cb 100644 (file)
@@ -48,10 +48,23 @@ export class DateUtil {
     }
 
     // Create a date in the local time zone with selected YMD values.
+    // Note that new Date(ymd) produces a date in UTC.  This version
+    // produces a date in the local time zone.
     static localDateFromYmd(ymd: string): Date {
         const parts = ymd.split('-');
         return new Date(
             Number(parts[0]), Number(parts[1]) - 1, Number(parts[2]));
     }
+
+    // Note that date.toISOString() produces a UTC date, which can have
+    // a different YMD value than a date in the local time zone.
+    // This variation returns values for the local time zone.
+    // Defaults to 'now' if no date is provided.
+    static localYmdFromDate(date?: Date): string {
+        const now = date || new Date();
+        return now.getFullYear() + '-' +
+            (now.getMonth() + '').padStart(2, '0') + '-' +
+            (now.getDate() + '').padStart(2, '0');
+    }
 }
 
index e21324a..77507e7 100644 (file)
@@ -97,6 +97,7 @@
           <a ngbNavLink i18n>Messages</a>
           <ng-template ngbNavContent>
             <div class="">
+              <eg-patron-messages [patronId]="patronId"></eg-patron-messages>
             </div>
           </ng-template>
         </li>
index 2b2d450..77b421b 100644 (file)
@@ -30,6 +30,7 @@ import {RegisterPatronComponent} from './register.component';
 import {SecondaryGroupsDialogComponent} from './secondary-groups.component';
 import {PatronBarcodesDialogComponent} from './barcodes.component';
 import {HoldNotifyUpdateDialogComponent} from './hold-notify-update.component';
+import {PatronMessagesComponent} from './messages.component';
 
 @NgModule({
   declarations: [
@@ -45,6 +46,7 @@ import {HoldNotifyUpdateDialogComponent} from './hold-notify-update.component';
     BillsComponent,
     BillStatementComponent,
     TestPatronPasswordComponent,
+    PatronMessagesComponent,
     PatronSurveyResponsesComponent,
     PatronGroupComponent,
     RegisterPatronComponent,