Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

diff-ymd-package

Package Overview
Dependencies
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

diff-ymd-package - npm Package Compare versions

Comparing version 1.0.3 to 1.0.4

18

CHANGELOG.md

@@ -6,3 +6,3 @@ ## Changelog

### [Unreleased] - 2024-01-15
### [Unreleased]

@@ -17,7 +17,7 @@ #### Added

### [v1.0.0-beta.1] - 2024-01-15 5:15 pm
### [v1.0.0-beta.1]
### [v1.0.0-beta.1] - 2024-01-15 9:30 pm🕤
### [v1.0.0-beta.2]
### [v1.0.0] - 2024-01-16
### [v1.0.0]

@@ -46,2 +46,8 @@ #### Fixed

### [v1.0.4]
#### Fixed
fixed some issues and configured files for publishing diff-ymd-package v1.0.4 on npm registry
### [Next Release] - Planning release time

@@ -51,4 +57,4 @@

- [Unreleased](https://github.com/farhan7reza7/diff-ymd-package/compare/v1.0.3...HEAD)
- [v1.0.3](https://github.com/farhan7reza7/diff-ymd-package/releases/tag/v1.0.3)
- [Unreleased](https://github.com/farhan7reza7/diff-ymd-package/compare/v1.0.4...HEAD)
- [v1.0.4](https://github.com/farhan7reza7/diff-ymd-package/releases/tag/v1.0.4)
- [Next Release](https://github.com/farhan7reza7/diff-ymd-package/milestone/2)
{
"name": "diff-ymd-package",
"version": "1.0.3",
"description": "Utility class for calculating the difference between two dates in (aYears bMonths cDays)(aY bM cD) format.",
"version": "1.0.4",
"description": "Utility class for calculating the difference between two dates in (aY bM cD)(aYears bMonths cDays) or customized formats like aY-bM-cD or aYears-bMonths-cDays etc.",
"main": "src/diff-ymd.js",

@@ -11,12 +11,15 @@ "scripts": {

"date",
"diff-ymd-package",
"ymd",
"diff-ymd",
"diff",
"dates",
"formatted difference",
"formatted dates difference",
"formatted",
"aY bM cD",
"aYears bMonths cDays",
"utility",
"difference",
"npm",
"package"
"formatted-difference",
"formatted-dates-difference",
"age-finder",
"age",
"customized-format",
"aY-bM-cD",
"aYears-bMonths-cDays",
"dates-difference"
],

@@ -38,5 +41,5 @@ "author": "Farhan Reza",

"bugs": {
"url": "https://github.com/farhan7reza7/diff-ymd-package/blob/main/.github/ISSUE_TEMPLATE/ISSUE_TEMPLATE.md"
"url": "https://github.com/farhan7reza7/diff-ymd-package/issues/new/choose"
},
"homepage": "https://github.com/farhan7reza7/diff-ymd-package/blob/main/README.md"
}
# diff-ymd-package
[![pages-build-deployment](https://github.com/farhan7reza7/diff-ymd-package/actions/workflows/pages/pages-build-deployment/badge.svg)](https://github.com/farhan7reza7/diff-ymd-package/actions/workflows/pages/pages-build-deployment)
> `diff-ymd-package` a javascript package provides APIs to difference dates in formatted ways(like (aYears bMonths cDays) or (aY bM cD) etc., eg. age = 20Y 2M 23D or datesDifference = 2Years 11Months 20Days)
[![NPM Version](https://img.shields.io/npm/v/diff-ymd-package)](https://www.npmjs.com/package/diff-ymd-package)
[![NPM Version][npm-image]][npm-url]
[![CI][ci-image]][ci-url]
[![License][license-image]][licence-url]
[![License](https://img.shields.io/github/license/farhan7reza7/diff-ymd-package)](https://opensource.org/licenses/MIT)
diff-ymd-package provides api to difference dates in formatted ways(like (aYears bMonths cDays) or (aY bM cD), eg. age = 20Y 2M 23D or datesDifference = 2Years 11Months 20Days)
## Installation

@@ -38,2 +36,3 @@

const calculator = new DatesYMD(date1, date2);
const result = calculator.formattedYMD();

@@ -43,3 +42,17 @@ const resultArray = calculator.diffArray();

console.log(result); // Output: "1Y 11M 30D"
// formatted output in aY bM cD format
console.log(resultArray); // Output: [1, 11, 30, '1Y 11M 30D']
/* you can access each of Y, M, D separately from output array and can format as per your choice like aY-bM-cD or aYears-bMonths-cDays etc.*/
/*example:
let Y, M, D;
Y = resultArray[0];
M = resultArray[1];
D = resultArray[2];
const customFormat = Y + 'years ' + M + 'months ' + D + 'days';
console.log(customFormat); // output: 1years 11months 30days
*/
```

@@ -56,3 +69,3 @@

```javascript
const calculator = new DatesYMD(firstDate, secondDate);
const Formatter = new DatesYMD(firstDate, secondDate);
```

@@ -76,3 +89,3 @@

**`formattedYMD()`**
Returns the formatted difference between two dates in aYears bMonths cDays(aY bM cD) format.
Returns the formatted difference between two dates in aY bM cD(aYears bMonths cDays) format.

@@ -85,3 +98,3 @@ ```javascript

[For more information, check out diff-ymd-package documentation](https://farhan7reza7.github.io/diff-ymd-package/DatesYMD.html)
[For more information, see `diff-ymd-package documentation`](https://farhan7reza7.github.io/diff-ymd-package/DatesYMD.html)

@@ -92,13 +105,8 @@ ## Contributing

## License
See [CONTRIBUTING.md](CONTRIBUTING.md) for more informations.
- This project is licensed under the MIT License - see the LICENSE file for details.
[License here](https://github.com/farhan7reza7/diff-ymd-package/blob/main/LICENSE)
## Best Practices:
## Additional Notes
### The code adheres to recommended practices for readability and maintainability, including:
### Best Practices`:`
#### The code adheres to recommended practices for readability and maintainability, including:
- Meaningful variable and function names for clarity.

@@ -108,5 +116,18 @@ - Clear and concise comments to enhance understanding.

### Important Links`:`
## License
- For more details about what has changed in each version of this project, please see the CHANGELOG.
[CHANGELOG here](https://github.com/farhan7reza7/diff-ymd-package/blob/main/CHANGELOG.md)
This project is licensed under the MIT License - see the LICENSE file for details.
[See License](https://github.com/farhan7reza7/diff-ymd-package/blob/main/LICENSE)
## History
For more details about what has changed in each version of this project, see the CHANGELOG.
See [CHANGELOG.md](CHANGELOG.md).
[npm-image]: https://img.shields.io/npm/v/diff-ymd-package
[npm-url]: https://www.npmjs.com/package/diff-ymd-package
[ci-image]: https://github.com/farhan7reza7/diff-ymd-package/actions/workflows/pages/pages-build-deployment/badge.svg
[ci-url]: https://github.com/farhan7reza7/diff-ymd-package/actions/workflows/pages/pages-build-deployment
[license-image]: https://img.shields.io/github/license/farhan7reza7/diff-ymd-package
[licence-url]: https://opensource.org/licenses/MIT
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc