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


TypeScript MomentFactory.currentDate方法代码示例

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


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

示例1: it

    it('should return CLAIMANT_ACCEPTED_COURT_PLAN_SETTLEMENT when a claimant has signed a settlement agreement', () => {
      claim.claimantResponse = {
        type: ClaimantResponseType.ACCEPTATION,
        formaliseOption: FormaliseOption.SETTLEMENT,
        courtDetermination: {
          decisionType: DecisionType.CLAIMANT,
          courtDecision: {
            paymentDate: MomentFactory.currentDate().add('1 year'),
            paymentOption: PaymentOption.BY_SPECIFIED_DATE
          },
          disposableIncome: 0,
          courtPaymentIntention: {
            paymentDate: MomentFactory.currentDate().add('6 months'),
            paymentOption: PaymentOption.BY_SPECIFIED_DATE
          }
        },
        claimantPaymentIntention: {
          paymentDate: MomentFactory.currentDate().add('1 year'),
          paymentOption: PaymentOption.BY_SPECIFIED_DATE
        }
      }
      const paymentIntention = {
        paymentOption: PaymentOption.BY_SPECIFIED_DATE,
        paymentDate: MomentFactory.currentDate()
      }
      claim.settlement = prepareSettlement(PaymentIntention.deserialize(paymentIntention), MadeBy.CLAIMANT)
      claim.respondedAt = MomentFactory.currentDateTime()

      expect(claim.status).to.be.equal(ClaimStatus.CLAIMANT_ACCEPTED_COURT_PLAN_SETTLEMENT)
    })
开发者ID:hmcts,项目名称:cmc-citizen-frontend,代码行数:30,代码来源:claim.ts

示例2: getClaimantPaymentIntention

 private static getClaimantPaymentIntention (draftClaimantResponse: DraftClaimantResponse): DomainPaymentIntention {
   const claimantPaymentIntention = draftClaimantResponse.alternatePaymentMethod.toDomainInstance()
   if (draftClaimantResponse.alternatePaymentMethod.paymentOption.option.value === PaymentOption.IMMEDIATELY) {
     claimantPaymentIntention.paymentDate = MomentFactory.currentDate().add(5, 'days')
   }
   return claimantPaymentIntention
 }
开发者ID:hmcts,项目名称:cmc-citizen-frontend,代码行数:7,代码来源:claimantResponseConverter.ts

示例3: it

  it('should return 1 for number of days when interest date starts from yesterday', async () => {
    const yesterday = MomentFactory.currentDate().subtract(1, 'days')
    const claim: Claim = new Claim().deserialize({ ...sampleClaimObj, issuedOn: yesterday })

    const { numberOfDays } = await getInterestDetails(claim) as any
    expect(numberOfDays).to.deep.eq(1)
  })
开发者ID:hmcts,项目名称:cmc-citizen-frontend,代码行数:7,代码来源:interestUtils.ts

示例4: 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

示例5: 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

示例6: it

  it('should return the correct earliest date where defendant pays set date in 50 days but claimant chooses pay by instalment in 55 days', () => {
    const claim = prepareClaim(fullAdmissionWithPaymentBySetDateDataPaymentDateAfterMonth)
    const claimantPaymentDate: moment.Moment = MomentFactory.currentDate().add(55, 'days')
    const paymentDate = getEarliestPaymentDateForPaymentPlan(claim, claimantPaymentDate)

    expect(paymentDate.toString()).to.equal(claimantPaymentDate.toString())
  })
开发者ID:hmcts,项目名称:cmc-citizen-frontend,代码行数:7,代码来源:paydateHelper.ts


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