refactor app.js, use moment, detect future alarms