commit
						dafeb4acb8
					
				| @ -18,7 +18,7 @@ | ||||
|                         <img [src]="badge.badgeurl" [alt]="badge.name" item-start core-external-content> | ||||
|                     </ion-avatar> | ||||
|                     <h2><core-format-text [text]="badge.name"></core-format-text></h2> | ||||
|                     <p>{{ badge.dateissued | coreToLocaleString }}</p> | ||||
|                     <p>{{ badge.dateissued * 1000 | coreFormatDate :'strftimedatetimeshort' }}</p> | ||||
|                     <ion-badge item-end color="danger" *ngIf="badge.dateexpire && currentTime >= badge.dateexpire"> | ||||
|                         {{ 'addon.badges.expired' | translate }} | ||||
|                     </ion-badge> | ||||
|  | ||||
| @ -527,11 +527,10 @@ export class AddonCalendarProvider { | ||||
|                 } | ||||
| 
 | ||||
|                 const dateTriggered = new Date((event.timestart - (time * 60)) * 1000), | ||||
|                     startDate = new Date(event.timestart * 1000), | ||||
|                     notification = { | ||||
|                         id: event.id, | ||||
|                         title: event.name, | ||||
|                         text: startDate.toLocaleString(), | ||||
|                         text: this.timeUtils.userDate(event.timestart * 1000, 'core.strftimedaydatetime', true), | ||||
|                         at: dateTriggered, | ||||
|                         channelParams: { | ||||
|                             channelID: 'notifications', | ||||
|  | ||||
| @ -75,7 +75,7 @@ | ||||
|                 <a ion-item text-wrap *ngIf="evidence.actionuser" (click)="openUserProfile(evidence.actionuser.id)"> | ||||
|                     <ion-avatar core-user-avatar [user]="evidence.actionuser" item-start></ion-avatar> | ||||
|                     <h2>{{ evidence.actionuser.fullname }}</h2> | ||||
|                     <p>{{ evidence.timemodified | coreToLocaleString }}</p> | ||||
|                     <p>{{ evidence.timemodified * 1000 | coreFormatDate }}</p> | ||||
|                 </a> | ||||
|                 <ion-item text-wrap> | ||||
|                     <p><ion-badge color="dark">{{ evidence.gradename }}</ion-badge></p> | ||||
|  | ||||
| @ -22,7 +22,7 @@ | ||||
|                 </ion-item> | ||||
|                 <ion-item text-wrap *ngIf="plan.plan.duedate > 0"> | ||||
|                     <strong>{{ 'addon.competency.duedate' | translate }}</strong>: | ||||
|                     {{ plan.plan.duedate | coreToLocaleString }} | ||||
|                     {{ plan.plan.duedate * 1000 | coreFormatDate }} | ||||
|                 </ion-item> | ||||
|                 <ion-item text-wrap *ngIf="plan.plan.template"> | ||||
|                     <strong>{{ 'addon.competency.template' | translate }}</strong>: | ||||
|  | ||||
| @ -14,7 +14,7 @@ | ||||
|             <ion-list *ngIf="plans.length > 0" no-margin> | ||||
|                 <a ion-item text-wrap *ngFor="let plan of plans" [title]="plan.name" (click)="openPlan(plan.id)" [class.core-split-item-selected]="plan.id == planId"> | ||||
|                     <h2>{{ plan.name }}</h2> | ||||
|                     <p *ngIf="plan.duedate > 0">{{ 'addon.competency.duedate' | translate }}: {{ plan.duedate | coreToLocaleString }}</p> | ||||
|                     <p *ngIf="plan.duedate > 0">{{ 'addon.competency.duedate' | translate }}: {{ plan.duedate * 1000 | coreFormatDate :'strftimedatetimeshort' }}</p> | ||||
|                     <ion-badge text-wrap [color]="plan.statuscolor">{{ plan.statusname }}</ion-badge> | ||||
|                 </a> | ||||
|             </ion-list> | ||||
|  | ||||
| @ -36,7 +36,7 @@ | ||||
|                     <ion-col><core-format-text clean="true" [text]="criteria.details.requirement"></core-format-text></ion-col> | ||||
|                     <ion-col><core-format-text [text]="criteria.details.status"></core-format-text></ion-col> | ||||
|                     <ion-col>{{ criteria.status }}</ion-col> | ||||
|                     <ion-col *ngIf="criteria.timecompleted">{{ criteria.timecompleted | coreToLocaleString }}</ion-col> | ||||
|                     <ion-col *ngIf="criteria.timecompleted">{{ criteria.timecompleted * 1000 | coreFormatDate :'strftimedatetimeshort' }}</ion-col> | ||||
|                     <ion-col *ngIf="!criteria.timecompleted"></ion-col> | ||||
|                 </ion-row> | ||||
|             </ion-item> | ||||
|  | ||||
| @ -102,6 +102,10 @@ export class CoreCompileHtmlComponent implements OnChanges, OnDestroy, DoCheck { | ||||
|                     this.created.emit(this.componentRef.instance); | ||||
|                 } | ||||
| 
 | ||||
|                 this.loaded = true; | ||||
|             }).catch((error) => { | ||||
|                 this.domUtils.showErrorModal(error); | ||||
| 
 | ||||
|                 this.loaded = true; | ||||
|             }); | ||||
|         } | ||||
|  | ||||
| @ -170,16 +170,20 @@ export class CoreCompileProvider { | ||||
|         // Now create the module containing the component.
 | ||||
|         const module = NgModule({imports: imports, declarations: [component]})(class {}); | ||||
| 
 | ||||
|         // Compile the module and the component.
 | ||||
|         return this.compiler.compileModuleAndAllComponentsAsync(module).then((factories) => { | ||||
|             // Search and return the factory of the component we just created.
 | ||||
|             for (const i in factories.componentFactories) { | ||||
|                 const factory = factories.componentFactories[i]; | ||||
|                 if (factory.componentType == component) { | ||||
|                     return factory; | ||||
|         try { | ||||
|             // Compile the module and the component.
 | ||||
|             return this.compiler.compileModuleAndAllComponentsAsync(module).then((factories) => { | ||||
|                 // Search and return the factory of the component we just created.
 | ||||
|                 for (const i in factories.componentFactories) { | ||||
|                     const factory = factories.componentFactories[i]; | ||||
|                     if (factory.componentType == component) { | ||||
|                         return factory; | ||||
|                     } | ||||
|                 } | ||||
|             } | ||||
|         }); | ||||
|             }); | ||||
|         } catch (ex) { | ||||
|             return Promise.reject({message: 'Template has some errors and cannot be displayed.', debuginfo: ex}); | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|  | ||||
| @ -14,6 +14,7 @@ | ||||
| 
 | ||||
| import { Pipe, PipeTransform } from '@angular/core'; | ||||
| import { CoreLoggerProvider } from '@providers/logger'; | ||||
| import { CoreTimeUtilsProvider } from '@providers/utils/time'; | ||||
| 
 | ||||
| /** | ||||
|  * Filter to format a timestamp to a locale string. Timestamp can be in seconds or milliseconds. | ||||
| @ -25,7 +26,7 @@ import { CoreLoggerProvider } from '@providers/logger'; | ||||
| export class CoreToLocaleStringPipe implements PipeTransform { | ||||
|     protected logger; | ||||
| 
 | ||||
|     constructor(logger: CoreLoggerProvider) { | ||||
|     constructor(logger: CoreLoggerProvider, private timeUtils: CoreTimeUtilsProvider) { | ||||
|         this.logger = logger.getInstance('CoreToLocaleStringPipe'); | ||||
|     } | ||||
| 
 | ||||
| @ -56,6 +57,6 @@ export class CoreToLocaleStringPipe implements PipeTransform { | ||||
|             timestamp = timestamp * 1000; | ||||
|         } | ||||
| 
 | ||||
|         return new Date(timestamp).toLocaleString(); | ||||
|         return this.timeUtils.userDate(timestamp, 'core.strftimedatetimeshort'); | ||||
|     } | ||||
| } | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user