Skip to content

Commit

Permalink
Merge pull request #177 from farhan7reza7/v3.1.2
Browse files Browse the repository at this point in the history
V3.1.2: update doc to document Date integration
  • Loading branch information
farhan7reza7 authored Mar 6, 2024
2 parents 353703c + 98e94e7 commit 2c22e35
Show file tree
Hide file tree
Showing 4 changed files with 100 additions and 16 deletions.
41 changes: 35 additions & 6 deletions docs/diff-dates.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,44 @@ <h1 class="page-title">Source: diff-dates.js</h1>

</div>

<nav>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="global.html#DatesYMD">DatesYMD</a></li></ul><h3>Global</h3><ul><li><a href="global.html#diffDates">diffDates</a></li></ul>
</nav>

<nav>
<h2><a href="index.html">Home</a></h2>
<h3>Classes</h3>
<ul>
<li><a href="global.html#DatesYMD">DatesYMD</a></li>
</ul>
<h3>Global</h3>
<ul>
<li><a href="global.html#DatesYMD">DatesYMD</a></li>
</ul>
<h3>Global object special method</h3>
<ul>
<li><a href="global.html#diffDates">diffDates</a></li>
</ul>
<h3>diff as Global Date Object method</h3>
<ul>
<li><a href="global.html#diff">diff</a></li>
</ul>
<h3>DatesYMD Methods</h3>
<ul>
<li><a href="global.html#customizeFormat">customizeFormat</a></li>
<li><a href="global.html#diffArray">diffArray</a></li>
<li><a href="global.html#diffInDays">diffInDays</a></li>
<li><a href="global.html#diffInHours">diffInHours</a></li>
<li><a href="global.html#diffInMinutes">diffInMinutes</a></li>
<li><a href="global.html#diffInMonths">diffInMonths</a></li>
<li><a href="global.html#diffInSeconds">diffInSeconds</a></li>
<li><a href="global.html#diffInWeeks">diffInWeeks</a></li>
<li><a href="global.html#diffInYears">diffInYears</a></li>
<li><a href="global.html#formattedYMD">formattedYMD</a></li>
</ul>
</nav>
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.2</a> on Wed Feb 28 2024 14:38:46 GMT+0530 (India Standard Time)
</footer>
Documentation generated for
<a href="https://www.npmjs.com/package/diff-ymd-package">diff-ymd-package</a>
</footer>

<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
Expand Down
6 changes: 4 additions & 2 deletions docs/diff-ymd.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -733,7 +733,6 @@ <h4>diff-ymd-package provides APIs for calculating the difference between two da
</article>
</section>
</div>

<nav>
<h2><a href="index.html">Home</a></h2>
<h3>Classes</h3>
Expand All @@ -748,6 +747,10 @@ <h3>Global object special method</h3>
<ul>
<li><a href="global.html#diffDates">diffDates</a></li>
</ul>
<h3>diff as Global Date Object method</h3>
<ul>
<li><a href="global.html#diff">diff</a></li>
</ul>
<h3>DatesYMD Methods</h3>
<ul>
<li><a href="global.html#customizeFormat">customizeFormat</a></li>
Expand All @@ -762,7 +765,6 @@ <h3>DatesYMD Methods</h3>
<li><a href="global.html#formattedYMD">formattedYMD</a></li>
</ul>
</nav>

<br class="clear" />

<footer>
Expand Down
9 changes: 7 additions & 2 deletions docs/global-DatesYMD.html
Original file line number Diff line number Diff line change
Expand Up @@ -1457,7 +1457,7 @@ <h5>Returns:</h5>

</div>

<nav>
<nav>
<h2><a href="index.html">Home</a></h2>
<h3>Classes</h3>
<ul>
Expand All @@ -1471,6 +1471,10 @@ <h3>Global object special method</h3>
<ul>
<li><a href="global.html#diffDates">diffDates</a></li>
</ul>
<h3>diff as Global Date Object method</h3>
<ul>
<li><a href="global.html#diff">diff</a></li>
</ul>
<h3>DatesYMD Methods</h3>
<ul>
<li><a href="global.html#customizeFormat">customizeFormat</a></li>
Expand All @@ -1487,11 +1491,12 @@ <h3>DatesYMD Methods</h3>
</nav>
<br class="clear">

<footer>
<footer>
Documentation generated for
<a href="https://www.npmjs.com/package/diff-ymd-package">diff-ymd-package</a>
</footer>


<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
Expand Down
60 changes: 54 additions & 6 deletions docs/index.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,23 @@ <h1 class="page-title">Source: index.js</h1>
*/
const diffDates = require("./diff-dates");

/**
* Makes the `diff` method available as the method of the Date object on importing the diff-ymd-package.
*
* This method creates an instance of DatesYMD to calculates the difference between Date instance and the passed date.
*
* @function
* @memberof Date.prototype
* @name diff
* @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.
*/
if (!Date.prototype.diff) {
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
module.exports.diffDates = diffDates; // named export for equivalent function
Expand All @@ -71,18 +88,49 @@ <h1 class="page-title">Source: index.js</h1>




</div>

<nav>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="global.html#DatesYMD">DatesYMD</a></li></ul><h3>Global</h3><ul><li><a href="global.html#diffDates">diffDates</a></li></ul>
</nav>
<nav>
<h2><a href="index.html">Home</a></h2>
<h3>Classes</h3>
<ul>
<li><a href="global.html#DatesYMD">DatesYMD</a></li>
</ul>
<h3>Global</h3>
<ul>
<li><a href="global.html#DatesYMD">DatesYMD</a></li>
</ul>
<h3>Global object special method</h3>
<ul>
<li><a href="global.html#diffDates">diffDates</a></li>
</ul>
<h3>diff as Global Date Object method</h3>
<ul>
<li><a href="global.html#diff">diff</a></li>
</ul>
<h3>DatesYMD Methods</h3>
<ul>
<li><a href="global.html#customizeFormat">customizeFormat</a></li>
<li><a href="global.html#diffArray">diffArray</a></li>
<li><a href="global.html#diffInDays">diffInDays</a></li>
<li><a href="global.html#diffInHours">diffInHours</a></li>
<li><a href="global.html#diffInMinutes">diffInMinutes</a></li>
<li><a href="global.html#diffInMonths">diffInMonths</a></li>
<li><a href="global.html#diffInSeconds">diffInSeconds</a></li>
<li><a href="global.html#diffInWeeks">diffInWeeks</a></li>
<li><a href="global.html#diffInYears">diffInYears</a></li>
<li><a href="global.html#formattedYMD">formattedYMD</a></li>
</ul>
</nav>

<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.2</a> on Wed Feb 28 2024 14:38:46 GMT+0530 (India Standard Time)
</footer>
Documentation generated for
<a href="https://www.npmjs.com/package/diff-ymd-package">diff-ymd-package</a>
</footer>



<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
Expand Down

0 comments on commit 2c22e35

Please sign in to comment.