In my application, I receive hours as strings such as "2230"
. I am looking for a way to add minutes to these hours in order to simulate the time after those minutes have been added. For example:
//"2230" + "60"mins = "23:30"
//"2230" + "180"mins = "02:30"
I have read about Moment.js possibly offering a solution, but I'm struggling with:
The correct method of formatting the hours initially using
moment("2230").format()
How to properly add minutes to it
Making sure it follows a 24-hour clock when adding the minutes