import { isNull } from 'lodash' ; import moment from 'moment' ; const hasToBeDisplayedNewNotification = ( dateLimit , lastDisplayedTime ) : boolean => { return dateLimit !== true || isNull ( lastDisplayedTime ) || moment ( lastDisplayedTime ) . diff ( moment ( ) , 'days' ) < 0 ; } ; export default hasToBeDisplayedNewNotification ;