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