MCPcopy Create free account
hub / github.com/scottrogowski/code2flow / getCalendarFormat

Function getCalendarFormat

tests/test_code/js/moment/moment.js:3708–3723  ·  view source on GitHub ↗
(myMoment, now)

Source from the content-addressed store, hash-verified

3706 }
3707
3708 function getCalendarFormat(myMoment, now) {
3709 var diff = myMoment.diff(now, 'days', true);
3710 return diff < -6
3711 ? 'sameElse'
3712 : diff < -1
3713 ? 'lastWeek'
3714 : diff < 0
3715 ? 'lastDay'
3716 : diff < 1
3717 ? 'sameDay'
3718 : diff < 2
3719 ? 'nextDay'
3720 : diff < 7
3721 ? 'nextWeek'
3722 : 'sameElse';
3723 }
3724
3725 function calendar$1(time, formats) {
3726 // Support for single parameter, formats only overload to the calendar function

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected