LSEG Data Library for TypeScript

About DatesAndCalendars AddPeriods

AddPeriods returns the date that tallies from adding a Period to a given date using one or more specified calendars.

IPA.DatesAndCalendars.AddPeriods.Definition object

This object creates the definition of information about the AddPeriods that we want to get.

Syntax

DatesAndCalendars.AddPeriods.Definition(params: DatesAndCalendars.AddPeriods.Params)

Parameters

Value Description Data type Optional Default value
params An object literal of type DatesAndCalendars.AddPeriods.Params. object No -

AddPeriods.Params properties

Value Description Data type Optional Default value
tag A user-defined string to identify the request. string Yes -
period The code indicating the tenor to be added to startDate to compute the resulting date. string No -
startDate The start date of the computation. The value is expressed in ISO 8601 format. string No -
calendars The list of comma-separated calendar codes used for the computation. string[] Yes -
currencies The list of comma-separated currency codes used for the computation. string[] Yes -
dateMovingConvention The method to adjust dates to working days (see DateMovingConvention). enum Yes -
endOfMonthConvention The method to adjust dates when they fall at the end of the month (see EndOfMonthConvention). enum Yes -
holidayOutputs Additional information about the holiday in case the resulting date falls on the holiday (see HolidayOutput). enum Yes -
extendedParams Additional parameters to apply to the request. object Yes -

Returned value

ContentDefinition object.

Usage

The following example demonstrates how to create a definition for add periods:

import { IPA } from '@lsegroup/data';

const definition = IPA.DatesAndCalendars.AddPeriods.Definition({
    tag: 'My request',
    startDate: '2018-01-01',
    period: '6M',
    calendars: ['EMU'],
    dateMovingConvention: IPA.DatesAndCalendars.DateMovingConvention.ModifiedFollowing,
    endOfMonthConvention: IPA.DatesAndCalendars.EndOfMonthConvention.Last,
});
`
223 words (1:10 mins)