TSService.setPeriod

Syntax

setPeriod (wbk, startDate, endDate, callback);

Parameters

wbk. Sets workbook value.

startDate. Sets starting date as 'YYYY-MM-DD'.

endDate. Sets end date as 'YYYY-MM-DD';

callback. Sets operation completion handler.

Description

The setPeriod method sets a period.

Example

To execute the example the page must contain the WorkbookBox component named workbookBox (see Example of Creating the WorkbookBox Component). Set data display period by running the following code in browser console:

	var wbk = workbookBox.getSource().getActiveSheet();
	var startDate = new Date();
	var endDate = new Date();
	tsService.setPeriod(wbk, startDate, endDate, PP.Delegate(onSetPeriod, this));    
	//setPeriod method execution end event handler
	function onSetPeriod(sender, args){
		workbookBox.refreshAll();
	}

After executing the example the table and chart show data for specified period, that is, for the current date. The dates in the Display Period group in the Home tab also change.

See also:

TSService