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


TypeScript MomentFactory.currentDateTime方法代码示例

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


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

示例1: it

  it(`should return 0 without calling an API when interest period is 0 days`, async () => {
    const interestFromDate = MomentFactory.currentDateTime()
    const interestToDate = MomentFactory.currentDateTime()
    const amount = await calculateInterest(100, 8, interestFromDate, interestToDate)

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

示例2: it

    it('should not be eligible when ccjType is Default', () => {
      const claim = new Claim()
      claim.countyCourtJudgment = {
        paymentOption: PaymentOption.IMMEDIATELY,
        ccjType: CountyCourtJudgmentType.DEFAULT
      } as CountyCourtJudgment
      claim.countyCourtJudgmentRequestedAt = MomentFactory.currentDateTime().subtract(20, 'days')
      claim.reDeterminationRequestedAt = MomentFactory.currentDateTime()

      expect(claim.isEligibleForReDetermination()).to.be.false
    })
开发者ID:hmcts,项目名称:cmc-citizen-frontend,代码行数:11,代码来源:claim.ts

示例3: it

      it('should render page when everything is fine', async () => {
        claimStoreServiceMock.resolveRetrieveClaimByExternalId({
          respondedAt: MomentFactory.currentDateTime(),
          countyCourtJudgmentRequestedAt: '2017-10-10T22:45:51.785',
          countyCourtJudgment: {
            defendantDateOfBirth: '1990-11-01',
            paidAmount: 2,
            paymentOption: 'INSTALMENTS',
            repaymentPlan: {
              instalmentAmount: 30,
              firstPaymentDate: '2018-11-11',
              paymentSchedule: 'EVERY_MONTH',
              completionDate: '2019-11-11',
              paymentLength: '12 months'
            },
            ccjType: CountyCourtJudgmentType.DETERMINATION
          },
          claimantResponse: {
            type: ClaimantResponseType.ACCEPTATION,
            amountPaid: 0
          }
        })

        await request(app)
          .get(pagePath)
          .set('Cookie', `${cookieName}=ABC`)
          .expect(res => expect(res).to.be.successful.withText('The repayment plan'))
      })
开发者ID:hmcts,项目名称:cmc-citizen-frontend,代码行数:28,代码来源:repayment-plan-summary.ts

示例4: admissionPayImmediatelyPastPaymentDate

 get admissionPayImmediatelyPastPaymentDate (): boolean {
   return this.response
     && (this.response.responseType === ResponseType.FULL_ADMISSION || this.response.responseType === ResponseType.PART_ADMISSION)
     && this.response.paymentIntention
     && this.response.paymentIntention.paymentOption === PaymentOption.IMMEDIATELY
     && this.response.paymentIntention.paymentDate.isBefore(MomentFactory.currentDateTime())
 }
开发者ID:hmcts,项目名称:cmc-citizen-frontend,代码行数:7,代码来源:claim.ts

示例5: it

        it('should render page when everything is fine', async () => {

          claimStoreServiceMock.resolveRetrieveClaimByExternalId({
            respondedAt: MomentFactory.currentDateTime(),
            countyCourtJudgmentRequestedAt: '2017-10-10T22:45:51.785',
            countyCourtJudgment: {
              defendantDateOfBirth: '1990-11-01',
              paidAmount: 2,
              paymentOption: 'INSTALMENTS',
              repaymentPlan: {
                instalmentAmount: 30,
                firstPaymentDate: '2018-11-11',
                paymentSchedule: 'EVERY_MONTH',
                completionDate: '2019-11-11',
                paymentLength: '12 months'
              },
              ccjType: CountyCourtJudgmentType.DETERMINATION
            },
            reDetermination: {
              explanation: 'I feel Defendant can pay earlier and I need money sooner',
              partyType: MadeBy.CLAIMANT.value
            },
            reDeterminationRequestedAt: '2017-10-11T22:45:51.785'
          })

          await request(app)
            .get(pagePath)
            .set('Cookie', `${cookieName}=ABC`)
            .expect(res => expect(res).to.be.successful.withText('You’ve asked for a judge to decide a repayment plan'))
        })
开发者ID:hmcts,项目名称:cmc-citizen-frontend,代码行数:30,代码来源:confirmation-redetermination.ts

示例6: eligibleForCCJ

 get eligibleForCCJ (): boolean {
   return !this.countyCourtJudgmentRequestedAt
     && (this.admissionPayImmediatelyPastPaymentDate
       || this.hasDefendantNotSignedSettlementAgreementInTime()
       || (!this.respondedAt && isPastDeadline(MomentFactory.currentDateTime(), this.responseDeadline))
     )
 }
开发者ID:hmcts,项目名称:cmc-citizen-frontend,代码行数:7,代码来源:claim.ts

示例7: async

  .get(Paths.taskListPage.uri, async (req: express.Request, res: express.Response, next: express.NextFunction) => {
    try {
      const draft: Draft<ResponseDraft> = res.locals.responseDraft
      const draftMediation: Draft<MediationDraft> = res.locals.mediationDraft
      const claim: Claim = res.locals.claim

      const beforeYouStartSection = TaskListBuilder
        .buildBeforeYouStartSection(draft.document, claim, MomentFactory.currentDateTime())
      const respondToClaimSection = TaskListBuilder
        .buildRespondToClaimSection(draft.document, claim)
      const resolvingClaimSection = TaskListBuilder
        .buildResolvingClaimSection(draft.document, claim, draftMediation.document)
      const directionsQuestionnaireSection = TaskListBuilder
        .buildDirectionsQuestionnaireSection(draft.document, claim)

      const submitSection = TaskListBuilder.buildSubmitSection(claim, draft.document, claim.externalId, claim.features)

      res.render(Paths.taskListPage.associatedView,
        {
          beforeYouStartSection: beforeYouStartSection,
          submitSection: submitSection,
          respondToClaimSection: respondToClaimSection,
          resolvingClaimSection: resolvingClaimSection,
          directionsQuestionnaireSection: directionsQuestionnaireSection,
          claim: claim
        })
    } catch (err) {
      next(err)
    }
  })
开发者ID:hmcts,项目名称:cmc-citizen-frontend,代码行数:30,代码来源:task-list.ts

示例8: calculateInterest

export async function calculateInterest (amount: number,
                                         interestRate: number,
                                         interestFromDate: Moment,
                                         interestToDate: Moment = MomentFactory.currentDateTime()): Promise<number> {
  if (interestToDate.diff(interestFromDate, 'days') > 0) {
    return InterestRateClient.calculateInterestRate(amount, interestRate, interestFromDate, interestToDate)
  }
  return 0
}
开发者ID:hmcts,项目名称:cmc-citizen-frontend,代码行数:9,代码来源:calculateInterest.ts


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