Skip to content

Commit

Permalink
Merge pull request #166 from farhan7reza7/global-int
Browse files Browse the repository at this point in the history
integrate diff correctly as the method of Date Object on imorting dif…
  • Loading branch information
farhan7reza7 authored Mar 5, 2024
2 parents 2813e19 + 56a92e9 commit b590637
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ const diffDates = require('./diff-dates');
* @param {string} date (type- String but Number for epoch, and Object for dateObject) - The date to be differed, in the format 'yyyy-mm-dd' or 'yyyy/mm/dd' or yyyy.mm.dd or dateString or dateObject or Timestamp(epoch).
* @returns {DatesYMD} An object containing methods for date difference calculations.
*/
Date.prototype.diff = function (date) {
return diffDates(this, date);
}
Date.prototype.diff = function (date) {
return diffDates(this, date);
};

// Export the DatesYMD class and equivalent function diffDates for usages in other modules
module.exports = DatesYMD; // default export for class
Expand Down

0 comments on commit b590637

Please sign in to comment.