mirror of
https://github.com/actions/stale.git
synced 2025-12-27 18:58:16 +00:00
* docs(readme): add a small precision about the operations-per-run closes #230 * chore(lint): ignore the lib folder for prettier * chore(date): add a function to check if a date is valid * chore(date): add a function to get a humanized date * chore(date): add a function to check if the date is more recent than * feat(date): add a start date to ignore old issues and PRs closes #174 * docs(readme): change the date to match the description * chore(date): add a better type for the date * docs(date): add missing JSDoc about the return type * chore(rebase): fix issues due to rebase * docs(readme): fix table formatting issues
19 lines
407 B
TypeScript
19 lines
407 B
TypeScript
/**
|
|
* @description
|
|
* Check if a date is valid
|
|
*
|
|
* @see
|
|
* https://stackoverflow.com/a/1353711/4440414
|
|
*
|
|
* @param {Readonly<Date>} date The date to check
|
|
*
|
|
* @returns {boolean} true when the given date is valid
|
|
*/
|
|
export function isValidDate(date: Readonly<Date>): boolean {
|
|
if (Object.prototype.toString.call(date) === '[object Date]') {
|
|
return !isNaN(date.getTime());
|
|
}
|
|
|
|
return false;
|
|
}
|