Train Scheduler utilizes Firebase and Moment.js to log train times, calculate the next time of arrival and the minutes until the train arrives.
- Bootstrap
- Javascript
- jQuery
- Firebase
- Moment.js
- None
Moment.js is a bit difficulty to work with due to their rather convoluted documentation. Due to how Moment.js works, it is necessary to subtract the time by 1 year when calculated the initial train time.
Example:
var firstTimeConverted = moment(firstTime, "HH:mm").subtract(1, "years");
console.log(firstTimeConverted);