Skip to content

Commit

Permalink
fix: lowered the bundle size quite a lot; (#346)
Browse files Browse the repository at this point in the history
  • Loading branch information
jacekk authored and mikeerickson committed Nov 21, 2019
1 parent f8a1e70 commit edfb041
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/rules.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
var dateTools = require('date-fns');
var isDateValid = require('date-fns/isValid');
var parseISO = require('date-fns/parseISO');

function leapYear(year) {
return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;
Expand All @@ -16,7 +17,7 @@ function isValidDate(inDate) {
inDate = inDate.replace(/\./g, '-');
}
if (inDate.length === 10) {
return dateTools.isValid(dateTools.parseISO(inDate));
return isDateValid(parseISO(inDate));
}
}

Expand Down

0 comments on commit edfb041

Please sign in to comment.