diff --git a/src/plugin/calendar/index.js b/src/plugin/calendar/index.js index d8a8b516f..6180ecf2b 100644 --- a/src/plugin/calendar/index.js +++ b/src/plugin/calendar/index.js @@ -12,7 +12,7 @@ export default (o, c, d) => { const proto = c.prototype proto.calendar = function (referenceTime, formats) { const format = formats || this.$locale().calendar || calendarFormat - const referenceStartOfDay = d(referenceTime || undefined).startOf('d') + const referenceStartOfDay = d(referenceTime === 0 ? 0 : referenceTime || undefined).startOf('d') const diff = this.diff(referenceStartOfDay, 'd', true) const sameElse = 'sameElse' /* eslint-disable no-nested-ternary */ @@ -30,4 +30,3 @@ export default (o, c, d) => { return this.format(currentFormat) } } -