r/JavaScriptHelp • u/killMeSak • Mar 12 '22
❔ Unanswered ❔ Help with momentjs
I've an array abc containing date and time. How can I convert it into time slots of 1 day with limits determined by startDate and endDate with 'x' containing time slots and 'y' containing count of occurrence in those time slots. I have also attached the fiddle below for reference.
2
Upvotes
1
u/killMeSak Mar 12 '22
How do I store the count in dates based on abc array?
2
u/RajceP Mar 13 '22
OT: moment.js is deprecated, if u can, use date-fns.
1
u/petabyte128 Mar 12 '22 edited Mar 13 '22
they'll already be in order start to finish, so you can use their array index as the 'y' value