本文整理匯總了TypeScript中@angular/common.DatePipe.transform方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript DatePipe.transform方法的具體用法?TypeScript DatePipe.transform怎麽用?TypeScript DatePipe.transform使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類@angular/common.DatePipe
的用法示例。
在下文中一共展示了DatePipe.transform方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: resolve
.subscribe((domainResponse: HttpResponse<DomainAssess>) => {
const domain: DomainAssess = domainResponse.body;
domain.createdDate = this.datePipe
.transform(domain.createdDate, 'yyyy-MM-ddTHH:mm:ss');
domain.modifiedDate = this.datePipe
.transform(domain.modifiedDate, 'yyyy-MM-ddTHH:mm:ss');
this.ngbModalRef = this.domainModalRef(component, domain);
resolve(this.ngbModalRef);
});
示例2: resolve
.subscribe((controlCategoryResponse: HttpResponse<ControlCategoryAssess>) => {
const controlCategory: ControlCategoryAssess = controlCategoryResponse.body;
controlCategory.createdDate = this.datePipe
.transform(controlCategory.createdDate, 'yyyy-MM-ddTHH:mm:ss');
controlCategory.modifiedDate = this.datePipe
.transform(controlCategory.modifiedDate, 'yyyy-MM-ddTHH:mm:ss');
this.ngbModalRef = this.controlCategoryModalRef(component, controlCategory);
resolve(this.ngbModalRef);
});
示例3: resolve
.subscribe((attachmentResponse: HttpResponse<AttachmentAssess>) => {
const attachment: AttachmentAssess = attachmentResponse.body;
attachment.createdDate = this.datePipe
.transform(attachment.createdDate, 'yyyy-MM-ddTHH:mm:ss');
attachment.modifiedDate = this.datePipe
.transform(attachment.modifiedDate, 'yyyy-MM-ddTHH:mm:ss');
this.ngbModalRef = this.attachmentModalRef(component, attachment);
resolve(this.ngbModalRef);
});
示例4: resolve
.subscribe((complianceFlagResponse: HttpResponse<ComplianceFlagAssess>) => {
const complianceFlag: ComplianceFlagAssess = complianceFlagResponse.body;
complianceFlag.createdDate = this.datePipe
.transform(complianceFlag.createdDate, 'yyyy-MM-ddTHH:mm:ss');
complianceFlag.modifiedDate = this.datePipe
.transform(complianceFlag.modifiedDate, 'yyyy-MM-ddTHH:mm:ss');
this.ngbModalRef = this.complianceFlagModalRef(component, complianceFlag);
resolve(this.ngbModalRef);
});
示例5: resolve
.subscribe((principlesResponse: HttpResponse<PrinciplesAssess>) => {
const principles: PrinciplesAssess = principlesResponse.body;
principles.createdDate = this.datePipe
.transform(principles.createdDate, 'yyyy-MM-ddTHH:mm:ss');
principles.modifiedDate = this.datePipe
.transform(principles.modifiedDate, 'yyyy-MM-ddTHH:mm:ss');
this.ngbModalRef = this.principlesModalRef(component, principles);
resolve(this.ngbModalRef);
});
示例6: transform
transform(value: any): any {
if (value === null || value === '') {
return '';
}
return (
this.datePipe.transform(value, 'shortDate') +
' ' +
this.datePipe.transform(value, 'mediumTime')
);
}
示例7: resolve
this.reservationService.find(id).subscribe((reservation) => {
reservation.date_Revservation = this.datePipe
.transform(reservation.date_Revservation, 'yyyy-MM-ddThh:mm');
reservation.date_debut = this.datePipe
.transform(reservation.date_debut, 'yyyy-MM-ddThh:mm');
reservation.date_fin = this.datePipe
.transform(reservation.date_fin, 'yyyy-MM-ddThh:mm');
this.ngbModalRef = this.reservationModalRef(component, reservation);
resolve(this.ngbModalRef);
});
示例8: eventDates
eventDates(start, end): string {
// Display single-day events as "Jan 7, 2018"
// Display multi-day events as "Aug 12, 2017 - Aug 13, 2017"
const startDate = this.datePipe.transform(start, 'mediumDate');
const endDate = this.datePipe.transform(end, 'mediumDate');
if (startDate === endDate) {
return startDate;
} else {
return `${startDate} - ${endDate}`;
}
}
示例9: it
it('should format with pattern aliases', () => {
expect(pipe.transform(date, 'medium')).toEqual('Jun 15, 2015, 9:03:01 PM');
expect(pipe.transform(date, 'short')).toEqual('6/15/2015, 9:03 PM');
expect(pipe.transform(date, 'dd/MM/yyyy')).toEqual('15/06/2015');
expect(pipe.transform(date, 'MM/dd/yyyy')).toEqual('06/15/2015');
expect(pipe.transform(date, 'fullDate')).toEqual('Monday, June 15, 2015');
expect(pipe.transform(date, 'longDate')).toEqual('June 15, 2015');
expect(pipe.transform(date, 'mediumDate')).toEqual('Jun 15, 2015');
expect(pipe.transform(date, 'shortDate')).toEqual('6/15/2015');
expect(pipe.transform(date, 'mediumTime')).toEqual('9:03:01 PM');
expect(pipe.transform(date, 'shortTime')).toEqual('9:03 PM');
});
示例10: resolve
.subscribe((assessmentScheduleResponse: HttpResponse<AssessmentScheduleAssess>) => {
const assessmentSchedule: AssessmentScheduleAssess = assessmentScheduleResponse.body;
assessmentSchedule.fromDate = this.datePipe
.transform(assessmentSchedule.fromDate, 'yyyy-MM-ddTHH:mm:ss');
assessmentSchedule.toDate = this.datePipe
.transform(assessmentSchedule.toDate, 'yyyy-MM-ddTHH:mm:ss');
assessmentSchedule.createdDate = this.datePipe
.transform(assessmentSchedule.createdDate, 'yyyy-MM-ddTHH:mm:ss');
assessmentSchedule.modifiedDate = this.datePipe
.transform(assessmentSchedule.modifiedDate, 'yyyy-MM-ddTHH:mm:ss');
this.ngbModalRef = this.assessmentScheduleModalRef(component, assessmentSchedule);
resolve(this.ngbModalRef);
});