當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript MomentFactory.parse方法代碼示例

本文整理匯總了TypeScript中shared/momentFactory.MomentFactory.parse方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript MomentFactory.parse方法的具體用法?TypeScript MomentFactory.parse怎麽用?TypeScript MomentFactory.parse使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在shared/momentFactory.MomentFactory的用法示例。


在下文中一共展示了MomentFactory.parse方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: it

    it('should extract the correct state for the claim issued', () => {
      const claim: Claim = new Claim().deserialize({
        ...sampleClaimIssueObj,
        response: {
          responseType: ResponseType.FULL_DEFENCE,
          freeMediation: FreeMediationOption.NO
        },
        settlement: {
          partyStatements: [
            {
              madeBy: 'DEFENDANT',
              type: 'COUNTERSIGNATURE'
            },
            {
              madeBy: 'CLAIMANT',
              type: 'ACCEPTATION'
            },
            {
              type: 'OFFER',
              madeBy: 'DEFENDANT',
              offer: {
                content: 'test',
                completionDate: MomentFactory.parse('2019-05-01')
              }
            }
          ]
        },
        settlementReachedAt: MomentFactory.parse('2019-03-01')
      })

      let claimState = fullDefenceTransitions(claim)
      claimState.findState(claimState)
      expect(claimState.state).to.equal('fd-settled-with-agreement')
    })
開發者ID:hmcts,項目名稱:cmc-citizen-frontend,代碼行數:34,代碼來源:full-defence-transitions.ts

示例2: deserialize

  deserialize (input?: any): RepaymentPlan {
    if (input) {
      this.instalmentAmount = input.instalmentAmount
      this.firstPaymentDate = MomentFactory.parse(input.firstPaymentDate)
      this.paymentSchedule = PaymentSchedule.of(input.paymentSchedule)
      if (input.completionDate) {
        this.completionDate = MomentFactory.parse(input.completionDate)
      }
      this.paymentLength = input.paymentLength
    }

    return this
  }
開發者ID:hmcts,項目名稱:cmc-citizen-frontend,代碼行數:13,代碼來源:repaymentPlan.ts

示例3: it

      it('should render page when everything is fine and CLAIMANT date is accepted', async () => {
        claimStoreServiceMock.resolveRetrieveClaimByExternalId(defendantFullAdmissionResponse)
        draftStoreServiceMock.resolveFind('claimantResponse', {
          courtDetermination: {
            decisionType: 'CLAIMANT',
            courtDecision: {
              paymentOption: 'BY_SPECIFIED_DATE',
              paymentDate: MomentFactory.parse('2018-11-01'),
              repaymentPlan: undefined }
          },
          alternatePaymentMethod: {
            paymentOption: {
              option: {
                value: 'BY_SPECIFIED_DATE',
                displayValue: 'By set date'
              }
            },
            paymentDate: new PaymentDate(new LocalDate(2018,11,1)),
            paymentPlan: undefined
          }
        })

        await request(app)
          .get(pagePath)
          .set('Cookie', `${cookieName}=ABC`)
          .expect(res => expect(res).to.be.successful.withText('The defendant can’t pay by your proposed date'))
      })
開發者ID:hmcts,項目名稱:cmc-citizen-frontend,代碼行數:27,代碼來源:court-offered-set-date.ts

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

示例5: deserialize

 public deserialize (input: any): CountyCourtJudgment {
   if (input) {
     if (input.defendantDateOfBirth) {
       this.defendantDateOfBirth = MomentFactory.parse(input.defendantDateOfBirth)
     }
     this.paymentOption = input.paymentOption
     this.paidAmount = toNumberOrUndefined(input.paidAmount)
     this.repaymentPlan = input.repaymentPlan ? new RepaymentPlan().deserialize(input.repaymentPlan) : undefined
     this.payBySetDate = input.payBySetDate ? MomentFactory.parse(input.payBySetDate) : undefined
     this.statementOfTruth = new StatementOfTruth().deserialize(input.statementOfTruth)
     if (input.ccjType) {
       this.ccjType = input.ccjType
     }
   }
   return this
 }
開發者ID:hmcts,項目名稱:cmc-citizen-frontend,代碼行數:16,代碼來源:countyCourtJudgment.ts

示例6: deserialize

 deserialize (input: any): Offer {
   if (input) {
     this.content = input.content
     this.completionDate = MomentFactory.parse(input.completionDate)
     this.paymentIntention = PaymentIntention.deserialize(input.paymentIntention)
   }
   return this
 }
開發者ID:hmcts,項目名稱:cmc-citizen-frontend,代碼行數:8,代碼來源:offer.ts

示例7: deserialize

  static deserialize (input: any): PaymentIntention {
    if (!input) {
      return input
    }

    const instance = new PaymentIntention()
    instance.paymentOption = input.paymentOption
    instance.paymentDate = input.paymentDate && MomentFactory.parse(input.paymentDate)
    instance.repaymentPlan = input.repaymentPlan && {
      instalmentAmount: input.repaymentPlan.instalmentAmount,
      firstPaymentDate: MomentFactory.parse(input.repaymentPlan.firstPaymentDate),
      paymentSchedule: input.repaymentPlan.paymentSchedule,
      completionDate: input.repaymentPlan.completionDate && MomentFactory.parse(input.repaymentPlan.completionDate),
      paymentLength: input.repaymentPlan.paymentLength
    }

    return instance
  }
開發者ID:hmcts,項目名稱:cmc-citizen-frontend,代碼行數:18,代碼來源:paymentIntention.ts

示例8: it

    it('should redirect to ccj error page', async () => {
      idamServiceMock.resolveRetrieveUserFor('1', 'citizen', 'letter-holder')
      claimStoreServiceMock.resolveRetrieveByLetterHolderId(
        '000MC000', { countyCourtJudgmentRequestedAt: MomentFactory.parse('2010-10-10') }
      )

      await request(app)
        .get(Paths.claimSummaryPage.uri)
        .set('Cookie', `${cookieName}=ABC;state = 000MC000`)
        .expect(res => expect(res).to.be.redirect.toLocation(ErrorPaths.ccjRequestedHandoffPage.uri))
    })
開發者ID:hmcts,項目名稱:cmc-citizen-frontend,代碼行數:11,代碼來源:claim-summary.ts

示例9: it

    it('should convert payment in full by specified date', () => {
      const paymentIntention = PaymentIntention.deserialize({
        paymentOption: { option: PaymentType.BY_SET_DATE },
        paymentDate: { date: new LocalDate(2018,12,31) }
      })

      const result = paymentIntention.toDomainInstance()
      expect(result.paymentOption).to.be.equal('BY_SPECIFIED_DATE')
      expect(result.paymentDate.toISOString()).to.be.deep.equal(MomentFactory.parse('2018-12-31').toISOString())
      expect(result.repaymentPlan).to.be.undefined
    })
開發者ID:hmcts,項目名稱:cmc-citizen-frontend,代碼行數:11,代碼來源:paymentIntention.ts


注:本文中的shared/momentFactory.MomentFactory.parse方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。