Skip to content

Commit

Permalink
updated for publishing diff-ymd-package v1.1.0 on npm registry
Browse files Browse the repository at this point in the history
  • Loading branch information
farhan7reza7 committed Jan 17, 2024
1 parent 62d7f51 commit e563860
Show file tree
Hide file tree
Showing 9 changed files with 509 additions and 575 deletions.
21 changes: 19 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,27 @@ fixed some issues and configured files for publishing diff-ymd-package v1.0.4 on

fixed some issues and configured files for publishing diff-ymd-package v1.0.5 on npm registry

### [v1.1.0]

#### Added

- Improved handling of customized formatting.
- Includes method for creating customized differrence formats.
- Included Unit test using Jest for customizing method.
- Included through comments in tests script

#### Changed

- Included through comments in tests script

#### Fixed

fixed some issues and configured files for publishing diff-ymd-package v1.1.0 on npm registry

### [Next Release] - Planning release time

### Important changes links:

- [Unreleased](https://github.com/farhan7reza7/diff-ymd-package/compare/v1.0.5...HEAD)
- [v1.0.5](https://github.com/farhan7reza7/diff-ymd-package/releases/tag/v1.0.5)
- [Unreleased](https://github.com/farhan7reza7/diff-ymd-package/compare/v1.1.0...HEAD)
- [v1.1.0](https://github.com/farhan7reza7/diff-ymd-package/releases/tag/v1.1.0)
- [Next Release](https://github.com/farhan7reza7/diff-ymd-package/milestone/2)
21 changes: 18 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ const customFormat = Y + 'years ' + M + 'months ' + D + 'days';
console.log(customFormat); // output: 1years 11months 30days
*/

// you can use this method for creating format of your choice
const customizedFormat = Formatter.customizeFormat('Ys', 'Ms', 'Ds', '-');

console.log(customizedFormat); // Output: "1Ys-2Ms-2Ds"
```

## API Documentation
Expand All @@ -67,7 +71,6 @@ Represents a utility class for calculating the formatted and customized differen

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

```

- **`firstDate`**: The first date in the format 'yyyy-mm-dd' or 'yyyy/mm/dd' or 'yyyy.mm.dd'.
Expand All @@ -80,7 +83,6 @@ Calculates the difference between two dates and returns an array containing Y(ye

```javascript
const result = Formatter.diffArray();

```

- **`Returns:`**
Expand All @@ -91,11 +93,24 @@ Returns the formatted difference between two dates in aY bM cD(aYears bMonths cD

```javascript
const result = Formatter.formattedYMD();

```

- **`Returns:`** A string in the format 'aY bM cD'.

**`customizeFormat(yearUnit, monthUnit, dayUnit, partSeparator)`**
Customizes the difference using specified units and separators

```javascript
const result = Formatter.customizeFormat(
yearUnit,
monthUnit,
dayUnit,
partSeparator,
);
```

- **`Returns:`** A customized formatted difference string of form (a + yearUnit + partSeparator + b + monthUnit + partSeparator + c + dayUnit), eg. aYs-bMs-cDs etc.

For more informations, [See `diff-ymd-package documentation`](https://farhan7reza7.github.io/diff-ymd-package/DatesYMD.html)

## Contributing
Expand Down
Loading

0 comments on commit e563860

Please sign in to comment.