Time Walk Demo

node v8.17.0
version: 3.0.0
endpointsharetweet
const moment = require('moment-timezone'); const { TimeWalk } = require('time-walk'); const start = new moment.tz('2017-07-01', 'Australia/Sydney'); const rule = new TimeWalk(start, { months: 1 }); const from = new moment.tz('2017-07-01', 'Australia/Sydney'); const to = new moment.tz('2018-01-01', 'Australia/Sydney'); // Note: Daylight savings change occurs first Sunday in October const resultDates = rule.between(from, to); console.log('result as dates', resultDates); const resultStr = rule.between(from, to, 'string'); console.log('result as string', resultStr);
Loading…

no comments

    sign in to comment