mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2026-04-23 22:45:06 -04:00
Remove some instances of moment that are not needed on the index to reduce the load
This commit is contained in:
@@ -1,11 +1,12 @@
|
||||
import moment from 'moment';
|
||||
|
||||
function isToday(date) {
|
||||
if (!date) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return moment(date).isSame(moment(), 'day');
|
||||
const dateObj = (typeof date === 'object') ? date : new Date(date);
|
||||
const today = new Date();
|
||||
|
||||
return dateObj.getDate() === today.getDate() && dateObj.getMonth() === today.getMonth() && dateObj.getFullYear() === today.getFullYear();
|
||||
}
|
||||
|
||||
export default isToday;
|
||||
|
||||
Reference in New Issue
Block a user