MCPcopy
hub / github.com/react-dates/react-dates / isSameDay

Function isSameDay

src/utils/isSameDay.js:3–10  ·  view source on GitHub ↗
(a, b)

Source from the content-addressed store, hash-verified

1import moment from 'moment';
2
3export default function isSameDay(a, b) {
4 if (!moment.isMoment(a) || !moment.isMoment(b)) return false;
5 // Compare least significant, most likely to change units first
6 // Moment's isSame clones moment inputs and is a tad slow
7 return a.date() === b.date()
8 && a.month() === b.month()
9 && a.year() === b.year();
10}

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…