icambron / twix.js

:hourglass::left_right_arrow: A date range plugin for moment.js
https://isaaccambron.com/twix.js/
MIT License
379 stars 54 forks source link

Twix trims of time when using .iterate() function #109

Open DheerajKN opened 5 years ago

DheerajKN commented 5 years ago

I am facing a problem with twix's iterate method as the result is trimming of the time from the results. Implementation: var itr = moment.twix(new Date('2012-01-15T16:30:00'),new Date('2012-03-20T16:30:00')).iterate("months");

Current Result:

2012-01-15T00:00:00
2012-01-16T00:00:00
2012-01-17T00:00:00
2012-01-18T00:00:00
2012-01-19T00:00:00
2012-01-20T00:00:00

But Expected:

2012-01-15T16:30:00
2012-01-16T16:30:00
2012-01-17T16:30:00
2012-01-18T16:30:00
2012-01-19T16:30:00
2012-01-20T16:30:00

So what has to be done to iterate method so that above result can be fetched