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

Function isSame

tests/test_code/js/moment/moment.js:3802–3818  ·  view source on GitHub ↗
(input, units)

Source from the content-addressed store, hash-verified

3800 }
3801
3802 function isSame(input, units) {
3803 var localInput = isMoment(input) ? input : createLocal(input),
3804 inputMs;
3805 if (!(this.isValid() && localInput.isValid())) {
3806 return false;
3807 }
3808 units = normalizeUnits(units) || 'millisecond';
3809 if (units === 'millisecond') {
3810 return this.valueOf() === localInput.valueOf();
3811 } else {
3812 inputMs = localInput.valueOf();
3813 return (
3814 this.clone().startOf(units).valueOf() <= inputMs &&
3815 inputMs <= this.clone().endOf(units).valueOf()
3816 );
3817 }
3818 }
3819
3820 function isSameOrAfter(input, units) {
3821 return this.isSame(input, units) || this.isAfter(input, units);

Callers

nothing calls this directly

Calls 3

isMomentFunction · 0.85
createLocalFunction · 0.85
normalizeUnitsFunction · 0.85

Tested by

no test coverage detected