3 ms·
Use https://momentjs.com https://momentjs.com instead moment('2022-02-05').isBetween(moment().startOf('day').subtract(1, 'day'), moment().endOf('day')); S
by Too 5y ago
Use https://momentjs.com https://momentjs.com instead
moment('2022-02-05').isBetween(moment().startOf('day').subtract(1, 'day'), moment().endOf('day'));
Still requires one import but that's hard to avoid. Don't be afraid of them, the IDE will usually add them automatically and hide them anyway. It's a good way to increase tracability maintainability, instead of magic stuff happening in the background.
- kavaruka 5y agomoment is dead, nowadays there are better libraries https://momentjs.com/docs/#/-project-status/ https://momentjs.com/docs/#/-project-status/