Skip to content

compute incrdatespace

kgryte edited this page May 12, 2015 · 1 revision

Generates an array of linearly spaced Date objects. If an increment is not provided, the default increment is day.

var stop = '2014-12-02T07:00:54.973Z',
	start = new Date( stop ) - 60000;

var arr = compute.incrdatespace( start, stop, '8sec' );
/* returns [
	'Mon Dec 01 2014 22:59:54 GMT-0800 (PST)',
	'Mon Dec 01 2014 23:00:06 GMT-0800 (PST)',
	'Mon Dec 01 2014 23:00:18 GMT-0800 (PST)',
	'Mon Dec 01 2014 23:00:30 GMT-0800 (PST)',
	'Mon Dec 01 2014 23:00:42 GMT-0800 (PST)'
]
*/

For function options, see the compute-incrdatespace module.

Clone this wiki locally