repl.txt (1073B)
1 2 {{alias}}( start, stop[, length][ , options] ) 3 Generates an array of linearly spaced dates. 4 5 Parameters 6 ---------- 7 start: number 8 Start time as either a `Date` object, Unix timestamp, JavaScript 9 timestamp, or date string. 10 11 stop: number 12 Stop time as either a `Date` object, Unix timestamp, JavaScript 13 timestamp, or date string. 14 15 length: integer (optional) 16 Length of output array. Default: `100`. 17 18 options: Object (optional) 19 Options. 20 21 options.round: string (optional) 22 Specifies how sub-millisecond times should be rounded: 23 [ 'floor', 'ceil', 'round' ]. Default: 'floor'. 24 25 Returns 26 ------- 27 arr: Array 28 Array of dates. 29 30 Examples 31 -------- 32 > var stop = '2014-12-02T07:00:54.973Z'; 33 > var start = new Date( stop ) - 60000; 34 > var arr = {{alias}}( start, stop, 6 ) 35 [...] 36 37 // Equivalent of Math.ceil(): 38 > var opts = { 'round': 'ceil' }; 39 > arr = {{alias}}( 1417503655000, 1417503655001, 3, opts ) 40 [...] 41 42 See Also 43 -------- 44