How to use the @fullcalendar/moment.toDuration function in @fullcalendar/moment

To help you get started, we’ve selected a few @fullcalendar/moment examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github fullcalendar / fullcalendar / packages / __tests__ / src / datelib / moment.js View on Github external
it('converts correctly', function() {
      let calendar = new Calendar(document.createElement('div'), {
        plugins: [ DayGridPlugin ],
        defaultTimedEventDuration: '05:00',
        defaultAllDayEventDuration: { days: 3 }
      })

      // hacky way to have a duration parsed
      let timedDuration = toDuration(calendar.defaultTimedEventDuration)
      let allDayDuration = toDuration(calendar.defaultAllDayEventDuration)

      expect(timedDuration.asHours()).toBe(5)
      expect(allDayDuration.asDays()).toBe(3)
    })
github fullcalendar / fullcalendar / packages / __tests__ / src / datelib / moment.js View on Github external
it('converts correctly', function() {
      let calendar = new Calendar(document.createElement('div'), {
        plugins: [ DayGridPlugin ],
        defaultTimedEventDuration: '05:00',
        defaultAllDayEventDuration: { days: 3 }
      })

      // hacky way to have a duration parsed
      let timedDuration = toDuration(calendar.defaultTimedEventDuration)
      let allDayDuration = toDuration(calendar.defaultAllDayEventDuration)

      expect(timedDuration.asHours()).toBe(5)
      expect(allDayDuration.asDays()).toBe(3)
    })

@fullcalendar/moment

Enhanced date formatting and conversion with Moment

MIT
Latest version published 4 months ago

Package Health Score

78 / 100
Full package analysis