File size: 533 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import moment from 'moment';

/**
 * Compares a domain's registration date to the current timestamp to determine if a domain was
 * registered recently. Defaults to an arbitrary limit of 30 minutes.
 * @param {import('moment').MomentInput} registrationDate
 * @param {number} numberOfMinutes
 * @returns {boolean}
 */
export function isRecentlyRegistered( registrationDate, numberOfMinutes = 30 ) {
	return (
		registrationDate &&
		moment.utc( registrationDate ).isAfter( moment.utc().subtract( numberOfMinutes, 'minutes' ) )
	);
}