mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-17 17:14:18 +02: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,13 @@
|
||||
import moment from 'moment';
|
||||
|
||||
function isTomorrow(date) {
|
||||
if (!date) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return moment(date).isSame(moment().add(1, 'day'), 'day');
|
||||
const dateObj = (typeof date === 'object') ? date : new Date(date);
|
||||
const today = new Date();
|
||||
const tomorrow = new Date((today.setDate(today.getDate() + 1)));
|
||||
|
||||
return dateObj.getDate() === tomorrow.getDate() && dateObj.getMonth() === tomorrow.getMonth() && dateObj.getFullYear() === tomorrow.getFullYear();
|
||||
}
|
||||
|
||||
export default isTomorrow;
|
||||
|
Reference in New Issue
Block a user