To use moment as date-framework in widespread JavaScript projects is common practice. Because of the powerful and easy to use API including an outstanding community support and regularly updates of this open-source project, we decide to replace our own date framework with moment.js. More advantages are the excellent documentation and fully commented source code for easier debugging.

For more information please visit: and

Some exemplary code replacements:

- create a new date object
oxDate: new date.Local()
moment: moment()

- diff between two date objects
oxDate: obj1.getDays() - obj2.getDays()
moment: obj1.diff(obj2, 'days')

- check if two dates on same day
oxDate: obj1.getDays() === obj2.getDays()
moment: obj1.isSame(obj2, 'day')

- set object to the start of next day
oxDate: obj.setDate(obj.getDate() + 1).setHours(0, 0, 0, 0)
moment: obj.add(1, 'day').startOf('day')

- get the local formatted time
oxDate: new date.Local().format(date.TIME)
moment: moment().format('LT')

- get translated duration string 5