better moment.js logic