In Myscenario, I am trying to generate the time list with 10 minutes intervals. I am using below code but not able to achieve exactly. Also, below code it is giving 24 hrs format but I need to achieve this using 12 hrs format.
for(var i=0;i<4;i++){ date.setMinutes(date.getMinutes() + interval); labels.push(`${date.getHours() +'.'+ date.getMinutes()}${suffix}`); labels.reverse(); }
Expected Output: [10.30PM, 10.40PM, 10.50PM, 11.00PM] //Current time 11.00PM should be last index.