Skip to content

Commit

Permalink
added codes hinting diff
Browse files Browse the repository at this point in the history
  • Loading branch information
farhan7reza7 committed Oct 15, 2024
1 parent f7bb4ab commit 8a90876
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
10 changes: 8 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -321,10 +321,16 @@ fixed some issues and configured files for publishing diff-ymd-package v2.0.2 on

- added diff-ymd-package.d.ts to resolve the types issue

### [v3.1.4]

#### Fixed

- added type for global Date integrated diff method in diff-ymd-package.d.ts for hinting in editor

### [Next Release] - Collecting issues and new features for next release

### Important changes links:

- [Unreleased](https://github.com/farhan7reza7/diff-ymd-package/compare/v3.1.3...HEAD)
- [v3.1.3](https://github.com/farhan7reza7/diff-ymd-package/releases/tag/v3.1.3)
- [Unreleased](https://github.com/farhan7reza7/diff-ymd-package/compare/v3.1.4...HEAD)
- [v3.1.4](https://github.com/farhan7reza7/diff-ymd-package/releases/tag/v3.1.4)
- [Next Release](https://github.com/farhan7reza7/diff-ymd-package/milestone/2)
7 changes: 7 additions & 0 deletions diff-ymd-package.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@ declare function diffDates(
secondDate: string | number | Date,
): DatesYMD;

// Extend the global Date interface to add the `diff` method
declare global {
interface Date {
diff(secondDate: string | number | Date): DatesYMD;
}
}

// The hybrid CommonJS module export:
declare const diffYMDPackage: typeof DatesYMD & {
diffDates: typeof diffDates;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "diff-ymd-package",
"version": "3.1.3",
"version": "3.1.4",
"description": "A javascript library for calculating the difference between two dates in formatted ways like (aY bM cD)(aYears bMonths cDays) or customized desired formats like aY-bM-cD or aYears-bMonths-cDays or kDays or mWeeks or nMonths etc.",
"main": "lib/index.js",
"scripts": {
Expand Down

0 comments on commit 8a90876

Please sign in to comment.