UNPKG

mout

Version:

Modular Utilities

15 lines (12 loc) 304 B
import startOf from './startOf'; /** * Check if date is "same" with optional period */ function isSame(date1, date2, period) { if (period) { date1 = startOf(date1, period); date2 = startOf(date2, period); } return Number(date1) === Number(date2); } export default isSame;