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


TypeScript LocalDate.fromMoment方法代码示例

本文整理汇总了TypeScript中forms/models/localDate.LocalDate.fromMoment方法的典型用法代码示例。如果您正苦于以下问题:TypeScript LocalDate.fromMoment方法的具体用法?TypeScript LocalDate.fromMoment怎么用?TypeScript LocalDate.fromMoment使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在forms/models/localDate.LocalDate的用法示例。


在下文中一共展示了LocalDate.fromMoment方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: it

    it('should accept affirmed reports with valid data', () => {
      const errors = validator.validateSync(new ExpertReports(true, [
        new ReportRow('B', LocalDate.fromMoment(MomentFactory.currentDate().subtract(1, 'day')))
      ]))

      expect(errors).to.be.empty
    })
开发者ID:hmcts,项目名称:cmc-citizen-frontend,代码行数:7,代码来源:expertReports.ts

示例2: retrieveDateOfBirthOfDefendant

 get retrieveDateOfBirthOfDefendant (): DateOfBirth {
   if (this.response && this.response.defendant.type === PartyType.INDIVIDUAL.value) {
     const defendantDateOfBirth: Moment = MomentFactory.parse((this.response.defendant as Individual).dateOfBirth)
     return new DateOfBirth(true, LocalDate.fromMoment(defendantDateOfBirth))
   }
   return undefined
 }
开发者ID:hmcts,项目名称:cmc-citizen-frontend,代码行数:7,代码来源:claim.ts

示例3: it

    it('should use provided values', () => {
      const tenDaysAgo = LocalDate.fromMoment(MomentFactory.currentDate().subtract(10, 'days'))
      const row: ReportRow = new ReportRow('John Doe', tenDaysAgo)

      expect(row.expertName).to.equal('John Doe')
      expect(row.reportDate).to.deep.equal(tenDaysAgo)
    })
开发者ID:hmcts,项目名称:cmc-citizen-frontend,代码行数:7,代码来源:reportRow.ts

示例4: retrieveAndSetValuesInDraft

function retrieveAndSetValuesInDraft (claim: Claim, draft: Draft<DraftCCJ>): Draft<DraftCCJ> {
  const paymentOption: CCJPaymentOption = retrievePaymentOptionsFromClaim(claim)
  if (paymentOption) {
    draft.document.paymentOption = paymentOption
    if (paymentOption && paymentOption.option.value === PaymentOption.INSTALMENTS) {
      draft.document.repaymentPlan = getRepaymentPlanForm(claim, draft)
    } else if (paymentOption && paymentOption.option.value === PaymentOption.BY_SPECIFIED_DATE) {
      draft.document.payBySetDate = new PaymentDate(LocalDate.fromMoment(claim.settlement.getLastOffer().paymentIntention.paymentDate))
    }
  }
  return draft
}
开发者ID:hmcts,项目名称:cmc-citizen-frontend,代码行数:12,代码来源:check-and-send.ts

示例5: it

          it('when payment plan has first payment date in the past', () => {
            const draft: ResponseDraft = new ResponseDraft()
            draft[admission.type] = new admission.clazz()
            draft[admission.type].paymentPlan = new PaymentPlan(
              100,
              10,
              LocalDate.fromMoment(MomentFactory.currentDate().subtract(1,'day')),
              PaymentSchedule.EVERY_MONTH
            )

            expect(YourRepaymentPlanTask.isCompleted(draft[admission.type].paymentPlan)).to.be.false
          })
开发者ID:hmcts,项目名称:cmc-citizen-frontend,代码行数:12,代码来源:yourRepaymentPlanTask.ts

示例6: async

   'but payment plan is rejected to be paid BY SET DATE', async () => {
   claimStoreServiceMock.resolveRetrieveClaimByExternalId(claimStoreServiceMock.samplePartialAdmissionWithPaymentBySetDateCompanyData)
   draftStoreServiceMock.resolveFind(draftType, {
     courtDetermination: undefined,
     acceptPaymentMethod: {
       accept: {
         option: 'no'
       }
     },
     settlementAgreement: {
       signed: false
     },
     alternatePaymentMethod: {
       paymentOption: {
         option: {
           value: 'BY_SPECIFIED_DATE',
           displayValue: 'By a set date'
         }
       },
       paymentDate: {
         date: LocalDate.fromMoment(MomentFactory.currentDate().add(50, 'days'))
       }
     },
     formaliseRepaymentPlan: {
       option: {
         value: 'referToJudge',
         displayValue: 'Refer to judge'
       }
     }
   })
   draftStoreServiceMock.resolveFind('mediation')
   await request(app)
     .get(pagePath)
     .set('Cookie', `${cookieName}=ABC`)
     .expect(res => expect(res).to.be.successful.withText('Check your answers'))
     .expect(res => expect(res).to.be.successful.withText('How would you like the defendant to pay', 'In full by'))
     .expect(res => expect(res).to.be.successful.withoutText('Court decision'))
 })
开发者ID:hmcts,项目名称:cmc-citizen-frontend,代码行数:38,代码来源:check-and-send.ts

示例7: context

  context('constructor', () => {
    const fiveDaysAgo: LocalDate = LocalDate.fromMoment(MomentFactory.currentDate().subtract(5, 'days'))

    it('should use defaults when no parameters given', () => {
      const reports: ExpertReports = new ExpertReports()
      expect(reports.declared).to.be.undefined

      expect(reports.rows).to.have.length(1)
      expect(reports.rows[0].expertName).to.be.undefined
      expect(reports.rows[0].reportDate).to.be.undefined
    })

    it('should use provided parameters', () => {
      const reports: ExpertReports = new ExpertReports(
        true,
        [new ReportRow('Mr Blobby', fiveDaysAgo)]
      )
      expect(reports.declared).to.be.true

      expect(reports.rows).to.have.length(1)
      expect(reports.rows[0].expertName).to.equal('Mr Blobby')
      expect(reports.rows[0].reportDate).to.deep.equal(fiveDaysAgo)
    })
  })
开发者ID:hmcts,项目名称:cmc-citizen-frontend,代码行数:24,代码来源:expertReports.ts


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