Browse Source

Avances notificaciones

Jose Brito 2 years ago
parent
commit
4e3dba84e9

+ 15 - 0
sistema-mantenimiento-front/src/app/components/template/template.component.css

@@ -365,4 +365,19 @@ footer {
   text-overflow: ellipsis;
   overflow: hidden;
   white-space: nowrap;
+  margin: 0;
+}
+
+.notification-container:hover{
+  opacity: 0.7;
+}
+
+.notification-item-module{
+  width: 100%;
+  font-weight: 300;
+  font-size: 12px;
+  text-overflow: ellipsis;
+  overflow: hidden;
+  white-space: nowrap;
+  margin: 0;
 }

+ 1 - 0
sistema-mantenimiento-front/src/app/components/template/template.component.html

@@ -450,6 +450,7 @@
       <div *ngFor="let notification of totalNotifications; let i = index" class="notification-container" 
       [ngClass]="{ notification_separator: i < totalNotifications.length - 1 }">
         <p class="notification-item-title">{{ notification.TITULO }}</p>
+        <p class="notification-item-module">{{ notification.FECREG }} &bullet; {{ notification.READED ? 'L' : 'No l' }}eído</p>
       </div>
     </mat-drawer>
     <div style="height: 100%; box-sizing: border-box; overflow: hidden;" (click)="closeNestedMenu()">

+ 6 - 6
sistema-mantenimiento-front/src/app/services/functions.service.ts

@@ -9,10 +9,10 @@ export class FunctionsService {
 
   constructor() { }
 
-  orderDate(date: string): string | undefined {
+  orderDate(date: string): string {
     let dateTimeArr = date.split(' ');
     if(dateTimeArr[0] == undefined || dateTimeArr[0] == 'undefined'){
-      return undefined;
+      return '';
     }else if(dateTimeArr[0].includes('T')){
       let dateJSArr = dateTimeArr[0].split('T');
       dateTimeArr[0] = dateJSArr[0];
@@ -21,18 +21,18 @@ export class FunctionsService {
     let dateArr = dateTimeArr[0].split('-');
     dateArr = dateArr.reverse();
 
-    let dateStr =dateArr.join('-');
+    let dateStr = dateArr.join('-');
     let timeArr = dateTimeArr[1].split(':');
     let hour = parseInt(timeArr[0]);
+    let period = hour < 12 ? 'AM' : 'PM';
 
-    let timeLapse = hour > 12 ? 'PM' : 'AM';
-    if(timeLapse == 'PM') hour = hour - 12;
+    if(hour > 12) hour = hour - 12;
     let hourStr = hour < 10 ? `0${hour}` : `${hour}`;
 
     timeArr[0] = hourStr;
     let timeStr = timeArr.join(':');
     
-    return `${dateStr} ${timeStr} ${timeLapse}`;
+    return `${dateStr} ${timeStr} ${period}`;
   }
 
   buildHumanDate(date: string): string{