當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。