Advertisement
anukattoju

Untitled

Nov 16th, 2018
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. export const isValidRevisitDate = (revisitDate) => {
  2. let errorList = [];
  3. if (revisitDate === null) {
  4. return [];
  5. }
  6. const RevisitDateObject = moment(revisitDate);
  7. const IsBeforeCurrentDate = RevisitDateObject.isBefore(moment());
  8. if (!isEmpty(revisitDate)) {
  9. if (IsBeforeCurrentDate === true) {
  10. errorList.push('Error');
  11. }
  12. }
  13. return errorList;
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement