当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript DatePipe.transform方法代码示例

本文整理汇总了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);
 });
开发者ID:mohammedik2005,项目名称:newProgram,代码行数:9,代码来源:domain-assess-popup.service.ts

示例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);
 });
开发者ID:mohammedik2005,项目名称:newProgram,代码行数:9,代码来源:control-category-assess-popup.service.ts

示例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);
 });
开发者ID:mohammedik2005,项目名称:newProgram,代码行数:9,代码来源:attachment-assess-popup.service.ts

示例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);
 });
开发者ID:mohammedik2005,项目名称:newProgram,代码行数:9,代码来源:compliance-flag-assess-popup.service.ts

示例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);
 });
开发者ID:mohammedik2005,项目名称:newProgram,代码行数:9,代码来源:principles-assess-popup.service.ts

示例6: transform

 transform(value: any): any {
   if (value === null || value === '') {
     return '';
   }
   return (
     this.datePipe.transform(value, 'shortDate') +
     ' ' +
     this.datePipe.transform(value, 'mediumTime')
   );
 }
开发者ID:LenzGr,项目名称:ceph,代码行数:10,代码来源:cd-date.pipe.ts

示例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);
 });
开发者ID:ATS01Dev,项目名称:HotMan,代码行数:10,代码来源:reservation-popup.service.ts

示例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}`;
    }
  }
开发者ID:connelb,项目名称:fitwithlc,代码行数:12,代码来源:utils.service.ts

示例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');
 });
开发者ID:BharatBhatiya,项目名称:test,代码行数:12,代码来源:date_pipe_spec.ts

示例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);
 });
开发者ID:mohammedik2005,项目名称:newProgram,代码行数:13,代码来源:assessment-schedule-assess-popup.service.ts


注:本文中的@angular/common.DatePipe.transform方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。