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