Download wp-calypso/client/lib/domains/utils/is-recently-registered.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 533 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/lib/domains/utils/is-recently-registered.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/client/lib/domains/utils/is-recently-registered.js
-
curl -L -o is-recently-registered.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/lib/domains/utils/is-recently-registered.js
533 Bytes
| 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' ) ) | |
| ); | |
| } | |