-
Notifications
You must be signed in to change notification settings - Fork 296
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
added file last modified validator #2096
base: master
Are you sure you want to change the base?
added file last modified validator #2096
Conversation
|
|
Hi @labibismaiel, Thanks for the PR 💪 !!
|
/** | ||
* Checks if the file's last modified date is within the specified range. | ||
* @param {Date} fileLastModifiedDate - The file's last modified date. | ||
* @param {Date} startDate - The start date of the allowed range. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* @param {Date} startDate - The start date of the allowed range. | |
* @param {Date} minDate - The start date of the allowed range. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make this inline with other date validators
* Checks if the file's last modified date is within the specified range. | ||
* @param {Date} fileLastModifiedDate - The file's last modified date. | ||
* @param {Date} startDate - The start date of the allowed range. | ||
* @param {Date} endDate - The end date of the allowed range. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* @param {Date} endDate - The end date of the allowed range. | |
* @param {Date} maxDate - The end date of the allowed range. |
File last modified date validator
This validator can be used to ensure that the uploaded file was last modified within a specific date range. This can be useful in scenarios where you want to ensure that users are uploading recent files, such as recent documents, photos, or reports.
To use this validator, you would provide the desired date range as parameters when adding it to a form element:
This would ensure that only files modified between January 1, 2022, and January 1, 2023, are considered valid.