chronos-date 1.2.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +104 -5
- package/dist/{convert-mMaI4YP0.mjs → convert-BY-uEIvg.mjs} +3 -3
- package/dist/{convert-DbgntRVW.cjs → convert-z8FAUOuh.cjs} +3 -3
- package/dist/{greet-D07t2_e6.mjs → greet-D89spydp.mjs} +1 -1
- package/dist/{greet-hjVsd2dt.cjs → greet-ok0_Wai_.cjs} +1 -1
- package/dist/guards.cjs +3 -3
- package/dist/guards.d.cts +1 -1
- package/dist/guards.d.mts +1 -1
- package/dist/guards.mjs +3 -3
- package/dist/{helpers-CQzi908i.cjs → helpers-D8yAKOsC.cjs} +3 -3
- package/dist/{helpers-DEf4sevD.mjs → helpers-eVQCueAC.mjs} +3 -3
- package/dist/index.cjs +22 -22
- package/dist/index.d.cts +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +22 -22
- package/dist/{non-primitives-DBtomDty.mjs → non-primitives-B38XfU4A.mjs} +1 -1
- package/dist/{non-primitives-D9zxCwX8.cjs → non-primitives-Dj558axv.cjs} +1 -1
- package/dist/plugins/banglaPlugin.cjs +4 -4
- package/dist/plugins/banglaPlugin.d.cts +2 -2
- package/dist/plugins/banglaPlugin.d.mts +2 -2
- package/dist/plugins/banglaPlugin.mjs +4 -4
- package/dist/plugins/businessPlugin.cjs +2 -2
- package/dist/plugins/businessPlugin.d.cts +10 -10
- package/dist/plugins/businessPlugin.d.mts +10 -10
- package/dist/plugins/businessPlugin.mjs +2 -2
- package/dist/plugins/dateRangePlugin.cjs +2 -2
- package/dist/plugins/dateRangePlugin.d.cts +2 -2
- package/dist/plugins/dateRangePlugin.d.mts +2 -2
- package/dist/plugins/dateRangePlugin.mjs +2 -2
- package/dist/plugins/dayPartPlugin.cjs +1 -1
- package/dist/plugins/dayPartPlugin.d.cts +2 -2
- package/dist/plugins/dayPartPlugin.d.mts +2 -2
- package/dist/plugins/dayPartPlugin.mjs +1 -1
- package/dist/plugins/durationPlugin.d.cts +2 -2
- package/dist/plugins/durationPlugin.d.mts +2 -2
- package/dist/plugins/fromNowPlugin.cjs +1 -1
- package/dist/plugins/fromNowPlugin.d.cts +2 -2
- package/dist/plugins/fromNowPlugin.d.mts +2 -2
- package/dist/plugins/fromNowPlugin.mjs +1 -1
- package/dist/plugins/greetingPlugin.cjs +1 -1
- package/dist/plugins/greetingPlugin.d.cts +2 -2
- package/dist/plugins/greetingPlugin.d.mts +2 -2
- package/dist/plugins/greetingPlugin.mjs +1 -1
- package/dist/plugins/palindromePlugin.cjs +2 -2
- package/dist/plugins/palindromePlugin.d.cts +2 -2
- package/dist/plugins/palindromePlugin.d.mts +2 -2
- package/dist/plugins/palindromePlugin.mjs +2 -2
- package/dist/plugins/relativeTimePlugin.d.cts +2 -2
- package/dist/plugins/relativeTimePlugin.d.mts +2 -2
- package/dist/plugins/roundPlugin.cjs +1 -1
- package/dist/plugins/roundPlugin.d.cts +3 -3
- package/dist/plugins/roundPlugin.d.mts +3 -3
- package/dist/plugins/roundPlugin.mjs +1 -1
- package/dist/plugins/seasonPlugin.d.cts +2 -2
- package/dist/plugins/seasonPlugin.d.mts +2 -2
- package/dist/plugins/timeZonePlugin.cjs +6 -6
- package/dist/plugins/timeZonePlugin.d.cts +6 -6
- package/dist/plugins/timeZonePlugin.d.mts +6 -6
- package/dist/plugins/timeZonePlugin.mjs +6 -6
- package/dist/plugins/zodiacPlugin.cjs +1 -1
- package/dist/plugins/zodiacPlugin.d.cts +2 -2
- package/dist/plugins/zodiacPlugin.d.mts +2 -2
- package/dist/plugins/zodiacPlugin.mjs +1 -1
- package/dist/{primitives-dXzXlzJw.mjs → primitives-DpMa2dS2.mjs} +1 -1
- package/dist/{primitives-CtuSNmV7.cjs → primitives-DutXlR0D.cjs} +1 -1
- package/dist/{types-CaVuY1_4.d.cts → types-DgRC-2cA.d.cts} +63 -48
- package/dist/{types-Bs_rfkka.d.mts → types-Nd89nk1B.d.mts} +63 -48
- package/dist/types.d.cts +2 -2
- package/dist/types.d.mts +2 -2
- package/dist/{utilities-BKtVo78T.mjs → utilities-BfGFB7aw.mjs} +4 -4
- package/dist/{utilities-D47SN9EZ.cjs → utilities-CZTvwfjY.cjs} +4 -4
- package/dist/{utilities-BGX8dviZ.mjs → utilities-C_cYlUNI.mjs} +4 -4
- package/dist/{utilities-CpF3uys3.cjs → utilities-CkQA3Fkh.cjs} +4 -4
- package/dist/utils.cjs +4 -4
- package/dist/utils.d.cts +1 -1
- package/dist/utils.d.mts +1 -1
- package/dist/utils.mjs +4 -4
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -1,8 +1,51 @@
|
|
|
1
|
-
# Chronos Date
|
|
2
|
-
|
|
3
|
-
A lightweight, immutable, and plugin-based date-time manipulation library for JavaScript and TypeScript.
|
|
4
|
-
|
|
5
|
-

|
|
1
|
+
# [Chronos Date](https://chronos.nazmul-nhb.dev/)
|
|
2
|
+
|
|
3
|
+
> A lightweight, immutable, and plugin-based date-time manipulation library for JavaScript and TypeScript.
|
|
4
|
+
|
|
5
|
+
[](https://chronos.nazmul-nhb.dev/)
|
|
6
|
+
|
|
7
|
+
<p>
|
|
8
|
+
<!-- Package Info -->
|
|
9
|
+
<a href="https://www.npmjs.com/package/chronos-date" aria-label="NPM Downloads">
|
|
10
|
+
<img src="https://img.shields.io/npm/dm/chronos-date.svg?label=DOWNLOADS&style=flat&color=red&logo=npm" alt="Downloads" />
|
|
11
|
+
</a>
|
|
12
|
+
<a href="https://www.npmjs.com/package/chronos-date" aria-label="Latest Version">
|
|
13
|
+
<img src="https://img.shields.io/npm/v/chronos-date.svg?label=NPM&style=flat&color=teal&logo=npm" alt="Latest Version" />
|
|
14
|
+
</a>
|
|
15
|
+
<a href="https://bundlejs.com/?q=chronos-date" aria-label="Bundle Size">
|
|
16
|
+
<img src="https://img.shields.io/bundlejs/size/chronos-date?label=Bundle%20Size&style=flat&color=blue&logo=npm" alt="Bundle Size" />
|
|
17
|
+
</a>
|
|
18
|
+
|
|
19
|
+
<!-- Project Metadata -->
|
|
20
|
+
<a href="https://github.com/nazmul-nhb/chronos-date" aria-label="TypeScript">
|
|
21
|
+
<img src="https://img.shields.io/badge/BUILT%20with-TypeScript-3178C6?style=flat&logo=typescript&logoColor=blue" alt="Built with TypeScript" />
|
|
22
|
+
</a>
|
|
23
|
+
<a href="https://github.com/nazmul-nhb/chronos-date/actions" aria-label="Build Status">
|
|
24
|
+
<img src="https://img.shields.io/github/actions/workflow/status/nazmul-nhb/chronos-date/publish.yml?label=BUILD%20%26%20PUBLISH&style=flat&logo=github" alt="Build Status" />
|
|
25
|
+
</a>
|
|
26
|
+
<a href="https://github.com/nazmul-nhb/chronos-date" aria-label="Project Status">
|
|
27
|
+
<img src="https://img.shields.io/badge/STATUS-maintained-brightgreen?style=flat&logo=git" alt="Maintained" />
|
|
28
|
+
</a>
|
|
29
|
+
<a href="https://github.com/nazmul-nhb/chronos-date/commits/main" aria-label="Last Commit">
|
|
30
|
+
<img src="https://img.shields.io/github/last-commit/nazmul-nhb/chronos-date?style=flat&label=LAST%20COMMIT&logo=git" alt="Last Commit" />
|
|
31
|
+
</a>
|
|
32
|
+
|
|
33
|
+
<!-- GitHub Meta -->
|
|
34
|
+
<a href="https://github.com/nazmul-nhb/chronos-date/stargazers" aria-label="GitHub Stars">
|
|
35
|
+
<img src="https://img.shields.io/github/stars/nazmul-nhb/chronos-date?style=flat&label=STARS&logo=github" alt="GitHub stars" />
|
|
36
|
+
</a>
|
|
37
|
+
<a href="https://github.com/nazmul-nhb/chronos-date/issues" aria-label="Open Issues">
|
|
38
|
+
<img src="https://img.shields.io/github/issues/nazmul-nhb/chronos-date?style=flat&label=ISSUES&logo=github" alt="Open Issues" />
|
|
39
|
+
</a>
|
|
40
|
+
<a href="https://github.com/nazmul-nhb/chronos-date/pulls" aria-label="Open Pull Requests">
|
|
41
|
+
<img src="https://img.shields.io/github/issues-pr/nazmul-nhb/chronos-date?style=flat&label=PRs&logo=github" alt="Pull Requests" />
|
|
42
|
+
</a>
|
|
43
|
+
|
|
44
|
+
<!-- License Info -->
|
|
45
|
+
<a href="https://www.npmjs.com/package/chronos-date" aria-label="License">
|
|
46
|
+
<img src="https://img.shields.io/npm/l/chronos-date.svg?label=LICENSE&style=flat&color=orange&logo=open-source-initiative" alt="License" />
|
|
47
|
+
</a>
|
|
48
|
+
</p>
|
|
6
49
|
|
|
7
50
|
## Why Chronos?
|
|
8
51
|
|
|
@@ -20,6 +63,8 @@ Designed to go beyond the native `Date` object, it empowers you to manipulate, f
|
|
|
20
63
|
- **Comprehensive TypeScript IntelliSense:** Built with first-class TypeScript types and granular tracking for strict date formatting tokens.
|
|
21
64
|
- **Cross-environment compatibility:** Works anywhere JS runs (Node.js, Browser, Deno, Bun).
|
|
22
65
|
|
|
66
|
+
---
|
|
67
|
+
|
|
23
68
|
## Installation
|
|
24
69
|
|
|
25
70
|
```sh
|
|
@@ -30,6 +75,8 @@ yarn add chronos-date
|
|
|
30
75
|
pnpm add chronos-date
|
|
31
76
|
```
|
|
32
77
|
|
|
78
|
+
---
|
|
79
|
+
|
|
33
80
|
## Quick Start
|
|
34
81
|
|
|
35
82
|
```ts
|
|
@@ -48,6 +95,8 @@ const eventDate = new Chronos('2025-12-31');
|
|
|
48
95
|
console.log(now.diff(eventDate, 'day')); // Days until event
|
|
49
96
|
```
|
|
50
97
|
|
|
98
|
+
---
|
|
99
|
+
|
|
51
100
|
## Modular Imports
|
|
52
101
|
|
|
53
102
|
You can import specific submodules for better tree-shaking:
|
|
@@ -70,10 +119,60 @@ import { timeZonePlugin } from "chronos-date/plugins/timeZonePlugin";
|
|
|
70
119
|
import { seasonPlugin } from "chronos-date/plugins/seasonPlugin";
|
|
71
120
|
```
|
|
72
121
|
|
|
122
|
+
---
|
|
123
|
+
|
|
73
124
|
## Documentation
|
|
74
125
|
|
|
75
126
|
For full documentation, API reference, and interactive playgrounds, visit the [**Documentation Site**](https://chronos.nazmul-nhb.dev/).
|
|
76
127
|
|
|
128
|
+
---
|
|
129
|
+
|
|
130
|
+
## 🔗 Related Packages
|
|
131
|
+
|
|
132
|
+
<div style={{ display: 'flex', alignItems: 'center', gap: '0.5rem' }}>
|
|
133
|
+
<a target="_blank" href="https://www.npmjs.com/package/nhb-toolbox">
|
|
134
|
+
<img src="https://img.shields.io/badge/NHB_Toolbox-nhb--toolbox-steelblue" alt="nhb-toolbox" />
|
|
135
|
+
</a>
|
|
136
|
+
</div>
|
|
137
|
+
|
|
138
|
+
<div style={{ display: 'flex', alignItems: 'center', gap: '0.5rem' }}>
|
|
139
|
+
<a target="_blank" href="https://www.npmjs.com/package/bn-calendar">
|
|
140
|
+
<img src="https://img.shields.io/badge/Bangla_Calendar-bn--calendar-red" alt="bn-calendar" />
|
|
141
|
+
</a>
|
|
142
|
+
</div>
|
|
143
|
+
|
|
144
|
+
<div style={{ display: 'flex', alignItems: 'center', gap: '0.5rem' }}>
|
|
145
|
+
<a target="_blank" href="https://www.npmjs.com/package/nhb-hooks">
|
|
146
|
+
<img src="https://img.shields.io/badge/React_Hooks-nhb--hooks-blue" alt="nhb-hooks" />
|
|
147
|
+
</a>
|
|
148
|
+
</div>
|
|
149
|
+
|
|
150
|
+
<div style={{ display: 'flex', alignItems: 'center', gap: '0.5rem' }}>
|
|
151
|
+
<a target="_blank" href="https://www.npmjs.com/package/locality-idb">
|
|
152
|
+
<img src="https://img.shields.io/badge/IndexedDB_ORM-locality--idb-darkviolet" alt="locality-idb" />
|
|
153
|
+
</a>
|
|
154
|
+
</div>
|
|
155
|
+
|
|
156
|
+
<div style={{ display: 'flex', alignItems: 'center', gap: '0.5rem' }}>
|
|
157
|
+
<a target="_blank" href="https://www.npmjs.com/package/nhb-scripts">
|
|
158
|
+
<img src="https://img.shields.io/badge/Development_Scripts-nhb--scripts-red" alt="nhb-scripts" />
|
|
159
|
+
</a>
|
|
160
|
+
</div>
|
|
161
|
+
|
|
162
|
+
<div style={{ display: 'flex', alignItems: 'center', gap: '0.5rem' }}>
|
|
163
|
+
<a target="_blank" href="https://www.npmjs.com/package/nhb-express">
|
|
164
|
+
<img src="https://img.shields.io/badge/Express_Server_Scaffolder-nhb--express-orange" alt="nhb-express" />
|
|
165
|
+
</a>
|
|
166
|
+
</div>
|
|
167
|
+
|
|
168
|
+
<div style={{ display: 'flex', alignItems: 'center', gap: '0.5rem' }}>
|
|
169
|
+
<a target="_blank" href="https://www.npmjs.com/package/nhb-anagram-generator">
|
|
170
|
+
<img src="https://img.shields.io/badge/Anagram_Generator-nhb--anagram--generator-teal" alt="nhb-anagram-generator" />
|
|
171
|
+
</a>
|
|
172
|
+
</div>
|
|
173
|
+
|
|
174
|
+
---
|
|
175
|
+
|
|
77
176
|
## License
|
|
78
177
|
|
|
79
178
|
This project is licensed under the [Apache License 2.0](LICENSE).
|
|
@@ -14,9 +14,9 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import { n as isNonEmptyString } from "./primitives-
|
|
17
|
+
import { n as isNonEmptyString } from "./primitives-DpMa2dS2.mjs";
|
|
18
18
|
|
|
19
|
-
//#region node_modules/.pnpm/nhb-toolbox@4.30.
|
|
19
|
+
//#region node_modules/.pnpm/nhb-toolbox@4.30.10/node_modules/nhb-toolbox/dist/esm/string/basics.js
|
|
20
20
|
function trimString(input) {
|
|
21
21
|
if (!input) return "";
|
|
22
22
|
if (isNonEmptyString(input)) return input.trim().replace(/\s+/g, " ");
|
|
@@ -25,7 +25,7 @@ function trimString(input) {
|
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
//#endregion
|
|
28
|
-
//#region node_modules/.pnpm/nhb-toolbox@4.30.
|
|
28
|
+
//#region node_modules/.pnpm/nhb-toolbox@4.30.10/node_modules/nhb-toolbox/dist/esm/string/convert.js
|
|
29
29
|
const reverseString = (input) => {
|
|
30
30
|
return trimString(input)?.split("")?.reverse()?.join("");
|
|
31
31
|
};
|
|
@@ -14,9 +14,9 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
const require_primitives = require('./primitives-
|
|
17
|
+
const require_primitives = require('./primitives-DutXlR0D.cjs');
|
|
18
18
|
|
|
19
|
-
//#region node_modules/.pnpm/nhb-toolbox@4.30.
|
|
19
|
+
//#region node_modules/.pnpm/nhb-toolbox@4.30.10/node_modules/nhb-toolbox/dist/esm/string/basics.js
|
|
20
20
|
function trimString(input) {
|
|
21
21
|
if (!input) return "";
|
|
22
22
|
if (require_primitives.isNonEmptyString(input)) return input.trim().replace(/\s+/g, " ");
|
|
@@ -25,7 +25,7 @@ function trimString(input) {
|
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
//#endregion
|
|
28
|
-
//#region node_modules/.pnpm/nhb-toolbox@4.30.
|
|
28
|
+
//#region node_modules/.pnpm/nhb-toolbox@4.30.10/node_modules/nhb-toolbox/dist/esm/string/convert.js
|
|
29
29
|
const reverseString = (input) => {
|
|
30
30
|
return trimString(input)?.split("")?.reverse()?.join("");
|
|
31
31
|
};
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
import { isValidTime } from "./guards.mjs";
|
|
18
|
-
import { n as extractHourMinute, p as getTotalMinutes } from "./utilities-
|
|
18
|
+
import { n as extractHourMinute, p as getTotalMinutes } from "./utilities-C_cYlUNI.mjs";
|
|
19
19
|
|
|
20
20
|
//#region src/utils/greet.ts
|
|
21
21
|
/**
|
package/dist/guards.cjs
CHANGED
|
@@ -16,9 +16,9 @@
|
|
|
16
16
|
|
|
17
17
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
18
18
|
const require_timezone = require('./timezone-BNnHFgki.cjs');
|
|
19
|
-
const require_primitives = require('./primitives-
|
|
20
|
-
const require_non_primitives = require('./non-primitives-
|
|
21
|
-
const require_utilities = require('./utilities-
|
|
19
|
+
const require_primitives = require('./primitives-DutXlR0D.cjs');
|
|
20
|
+
const require_non_primitives = require('./non-primitives-Dj558axv.cjs');
|
|
21
|
+
const require_utilities = require('./utilities-CkQA3Fkh.cjs');
|
|
22
22
|
|
|
23
23
|
//#region src/guards.ts
|
|
24
24
|
/**
|
package/dist/guards.d.cts
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import {
|
|
17
|
+
import { Cn as Numeric, Mt as TimeZoneIdNative, Ot as TimeWithUnit, Rt as UTCOffset, Z as $TimeZoneIdentifier, it as ClockTime, st as DateLike } from "./types-DgRC-2cA.cjs";
|
|
18
18
|
|
|
19
19
|
//#region src/guards.d.ts
|
|
20
20
|
/**
|
package/dist/guards.d.mts
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import {
|
|
17
|
+
import { Cn as Numeric, Mt as TimeZoneIdNative, Ot as TimeWithUnit, Rt as UTCOffset, Z as $TimeZoneIdentifier, it as ClockTime, st as DateLike } from "./types-Nd89nk1B.mjs";
|
|
18
18
|
|
|
19
19
|
//#region src/guards.d.ts
|
|
20
20
|
/**
|
package/dist/guards.mjs
CHANGED
|
@@ -15,9 +15,9 @@
|
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
import { n as NATIVE_TZ_IDS, t as IANA_TZ_IDS } from "./timezone-Db2CeL32.mjs";
|
|
18
|
-
import { n as isNonEmptyString, t as isBoolean } from "./primitives-
|
|
19
|
-
import { r as isObject, t as isFunction } from "./non-primitives-
|
|
20
|
-
import { a as isNumericString, n as normalizeNumber } from "./utilities-
|
|
18
|
+
import { n as isNonEmptyString, t as isBoolean } from "./primitives-DpMa2dS2.mjs";
|
|
19
|
+
import { r as isObject, t as isFunction } from "./non-primitives-B38XfU4A.mjs";
|
|
20
|
+
import { a as isNumericString, n as normalizeNumber } from "./utilities-BfGFB7aw.mjs";
|
|
21
21
|
|
|
22
22
|
//#region src/guards.ts
|
|
23
23
|
/**
|
|
@@ -15,9 +15,9 @@
|
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
const require_basic = require('./basic-DsQqC5nZ.cjs');
|
|
18
|
-
const require_primitives = require('./primitives-
|
|
19
|
-
const require_non_primitives = require('./non-primitives-
|
|
20
|
-
const require_utilities = require('./utilities-
|
|
18
|
+
const require_primitives = require('./primitives-DutXlR0D.cjs');
|
|
19
|
+
const require_non_primitives = require('./non-primitives-Dj558axv.cjs');
|
|
20
|
+
const require_utilities = require('./utilities-CkQA3Fkh.cjs');
|
|
21
21
|
const require_guards = require('./guards.cjs');
|
|
22
22
|
|
|
23
23
|
//#region src/utils/helpers.ts
|
|
@@ -15,9 +15,9 @@
|
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
import { c as MONTHS, d as SORTED_TIME_FORMATS, i as BN_SEASONS, o as DAYS, r as BN_MONTH_TABLES, u as MS_PER_DAY } from "./basic-DqKyujoj.mjs";
|
|
18
|
-
import { i as isString, n as isNonEmptyString } from "./primitives-
|
|
19
|
-
import { a as isValidArray, i as isObjectWithKeys } from "./non-primitives-
|
|
20
|
-
import { t as getOrdinal } from "./utilities-
|
|
18
|
+
import { i as isString, n as isNonEmptyString } from "./primitives-DpMa2dS2.mjs";
|
|
19
|
+
import { a as isValidArray, i as isObjectWithKeys } from "./non-primitives-B38XfU4A.mjs";
|
|
20
|
+
import { t as getOrdinal } from "./utilities-BfGFB7aw.mjs";
|
|
21
21
|
import { isDate, isDateString, isLeapYear, isValidUTCOffset } from "./guards.mjs";
|
|
22
22
|
|
|
23
23
|
//#region src/utils/helpers.ts
|
package/dist/index.cjs
CHANGED
|
@@ -16,11 +16,11 @@
|
|
|
16
16
|
|
|
17
17
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
18
18
|
const require_basic = require('./basic-DsQqC5nZ.cjs');
|
|
19
|
-
const require_primitives = require('./primitives-
|
|
20
|
-
const require_non_primitives = require('./non-primitives-
|
|
19
|
+
const require_primitives = require('./primitives-DutXlR0D.cjs');
|
|
20
|
+
const require_non_primitives = require('./non-primitives-Dj558axv.cjs');
|
|
21
21
|
const require_guards = require('./guards.cjs');
|
|
22
|
-
const require_helpers = require('./helpers-
|
|
23
|
-
const require_utilities = require('./utilities-
|
|
22
|
+
const require_helpers = require('./helpers-D8yAKOsC.cjs');
|
|
23
|
+
const require_utilities = require('./utilities-CZTvwfjY.cjs');
|
|
24
24
|
|
|
25
25
|
//#region src/utils/chronos-fn.ts
|
|
26
26
|
/**
|
|
@@ -641,46 +641,46 @@ var Chronos = class Chronos {
|
|
|
641
641
|
/**
|
|
642
642
|
* @instance Checks if another date is the same as this one in a specific unit.
|
|
643
643
|
* @param other The other date to compare.
|
|
644
|
-
* @param unit The unit to compare.
|
|
645
|
-
* @param weekStartsOn Optional: Day the week starts on (0 = Sunday, 1 = Monday).
|
|
644
|
+
* @param unit The unit to compare. Default is `'millisecond'`.
|
|
645
|
+
* @param weekStartsOn Optional: Day the week starts on (0 = Sunday, 1 = Monday). Default is `0`. Applicable when {@link unit} is `'week'`.
|
|
646
646
|
*/
|
|
647
|
-
isSame(other, unit, weekStartsOn = 0) {
|
|
647
|
+
isSame(other, unit = "millisecond", weekStartsOn = 0) {
|
|
648
648
|
return this.startOf(unit, weekStartsOn).#timestamp === Chronos.#cast(other).startOf(unit, weekStartsOn).#timestamp;
|
|
649
649
|
}
|
|
650
650
|
/**
|
|
651
651
|
* @instance Checks if this date is before another date in a specific unit.
|
|
652
652
|
* @param other The other date to compare.
|
|
653
|
-
* @param unit The unit to compare.
|
|
654
|
-
* @param weekStartsOn Optional: Day the week starts on (0 = Sunday, 1 = Monday).
|
|
653
|
+
* @param unit The unit to compare. Default is ``millisecond``.
|
|
654
|
+
* @param weekStartsOn Optional: Day the week starts on (0 = Sunday, 1 = Monday). Default is `0`. Applicable when {@link unit} is `'week'`.
|
|
655
655
|
*/
|
|
656
|
-
isBefore(other, unit, weekStartsOn = 0) {
|
|
656
|
+
isBefore(other, unit = "millisecond", weekStartsOn = 0) {
|
|
657
657
|
return this.startOf(unit, weekStartsOn).#timestamp < Chronos.#cast(other).startOf(unit, weekStartsOn).#timestamp;
|
|
658
658
|
}
|
|
659
659
|
/**
|
|
660
660
|
* @instance Checks if this date is after another date in a specific unit.
|
|
661
661
|
* @param other The other date to compare.
|
|
662
|
-
* @param unit The unit to compare.
|
|
663
|
-
* @param weekStartsOn Optional: Day the week starts on (0 = Sunday, 1 = Monday).
|
|
662
|
+
* @param unit The unit to compare. Default is `'millisecond'`.
|
|
663
|
+
* @param weekStartsOn Optional: Day the week starts on (0 = Sunday, 1 = Monday). Default is `0`. Applicable when {@link unit} is `'week'`.
|
|
664
664
|
*/
|
|
665
|
-
isAfter(other, unit, weekStartsOn = 0) {
|
|
665
|
+
isAfter(other, unit = "millisecond", weekStartsOn = 0) {
|
|
666
666
|
return this.startOf(unit, weekStartsOn).#timestamp > Chronos.#cast(other).startOf(unit, weekStartsOn).#timestamp;
|
|
667
667
|
}
|
|
668
668
|
/**
|
|
669
669
|
* @instance Checks if this date is the same or before another date in a specific unit.
|
|
670
670
|
* @param other The other date to compare.
|
|
671
|
-
* @param unit The unit to compare.
|
|
672
|
-
* @param weekStartsOn Optional: Day the week starts on (0 = Sunday, 1 = Monday).
|
|
671
|
+
* @param unit The unit to compare. Default is `'millisecond'`.
|
|
672
|
+
* @param weekStartsOn Optional: Day the week starts on (0 = Sunday, 1 = Monday). Default is `0`. Applicable when {@link unit} is `'week'`.
|
|
673
673
|
*/
|
|
674
|
-
isSameOrBefore(other, unit, weekStartsOn = 0) {
|
|
674
|
+
isSameOrBefore(other, unit = "millisecond", weekStartsOn = 0) {
|
|
675
675
|
return this.isSame(other, unit, weekStartsOn) || this.isBefore(other, unit, weekStartsOn);
|
|
676
676
|
}
|
|
677
677
|
/**
|
|
678
678
|
* @instance Checks if this date is the same or after another date in a specific unit.
|
|
679
679
|
* @param other The other date to compare.
|
|
680
|
-
* @param unit The unit to compare.
|
|
681
|
-
* @param weekStartsOn Optional: Day the week starts on (0 = Sunday, 1 = Monday).
|
|
680
|
+
* @param unit The unit to compare. Default is `'millisecond'`.
|
|
681
|
+
* @param weekStartsOn Optional: Day the week starts on (0 = Sunday, 1 = Monday). Default is `0`. Applicable when {@link unit} is `'week'`.
|
|
682
682
|
*/
|
|
683
|
-
isSameOrAfter(other, unit, weekStartsOn = 0) {
|
|
683
|
+
isSameOrAfter(other, unit = "millisecond", weekStartsOn = 0) {
|
|
684
684
|
return this.isSame(other, unit, weekStartsOn) || this.isAfter(other, unit, weekStartsOn);
|
|
685
685
|
}
|
|
686
686
|
/**
|
|
@@ -739,7 +739,7 @@ var Chronos = class Chronos {
|
|
|
739
739
|
/**
|
|
740
740
|
* @instance Returns a new `Chronos` instance at the start of a given unit.
|
|
741
741
|
* @param unit The unit to reset (e.g., year, month, day).
|
|
742
|
-
* @param weekStartsOn Optional: Day the week starts on (0 = Sunday, 1 = Monday).
|
|
742
|
+
* @param weekStartsOn Optional: Day the week starts on (0 = Sunday, 1 = Monday). Default is `0`. Applicable when {@link unit} is `'week'`.
|
|
743
743
|
*/
|
|
744
744
|
startOf(unit, weekStartsOn = 0) {
|
|
745
745
|
const d = new Date(this.#date);
|
|
@@ -777,7 +777,7 @@ var Chronos = class Chronos {
|
|
|
777
777
|
/**
|
|
778
778
|
* @instance Returns a new `Chronos` instance at the end of a given unit.
|
|
779
779
|
* @param unit The unit to adjust (e.g., year, month, day).
|
|
780
|
-
* @param weekStartsOn Optional: Day the week starts on (0 = Sunday, 1 = Monday).
|
|
780
|
+
* @param weekStartsOn Optional: Day the week starts on (0 = Sunday, 1 = Monday). Default is `0`. Applicable when {@link unit} is `'week'`.
|
|
781
781
|
*/
|
|
782
782
|
endOf(unit, weekStartsOn = 0) {
|
|
783
783
|
const instance = this.startOf(unit, weekStartsOn).add(1, unit).add(-1, "millisecond");
|
|
@@ -972,7 +972,7 @@ var Chronos = class Chronos {
|
|
|
972
972
|
}
|
|
973
973
|
/**
|
|
974
974
|
* @instance Calculates the week number of the year based on custom week start.
|
|
975
|
-
* @param weekStartsOn Optional: Day the week starts on (0 = Sunday, 1 = Monday).
|
|
975
|
+
* @param weekStartsOn Optional: Day the week starts on (0 = Sunday, 1 = Monday). Default is `0`. Applicable when {@link unit} is `'week'`.
|
|
976
976
|
* @returns Week number (1-53).
|
|
977
977
|
*/
|
|
978
978
|
getWeekOfYear(weekStartsOn = 0) {
|
package/dist/index.d.cts
CHANGED
package/dist/index.d.mts
CHANGED
package/dist/index.mjs
CHANGED
|
@@ -15,11 +15,11 @@
|
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
import { c as MONTHS, o as DAYS, s as INTERNALS, u as MS_PER_DAY } from "./basic-DqKyujoj.mjs";
|
|
18
|
-
import { r as isNumber } from "./primitives-
|
|
19
|
-
import { t as isFunction } from "./non-primitives-
|
|
18
|
+
import { r as isNumber } from "./primitives-DpMa2dS2.mjs";
|
|
19
|
+
import { t as isFunction } from "./non-primitives-B38XfU4A.mjs";
|
|
20
20
|
import { isDateString, isLeapYear } from "./guards.mjs";
|
|
21
|
-
import { c as _hasChronosProperties, n as _dateArgsToDate, p as _resolveNativeTzName, r as _formatDate, u as _normalizeOffset } from "./helpers-
|
|
22
|
-
import { l as getNativeTimeZoneId, r as extractMinutesFromUTC } from "./utilities-
|
|
21
|
+
import { c as _hasChronosProperties, n as _dateArgsToDate, p as _resolveNativeTzName, r as _formatDate, u as _normalizeOffset } from "./helpers-eVQCueAC.mjs";
|
|
22
|
+
import { l as getNativeTimeZoneId, r as extractMinutesFromUTC } from "./utilities-C_cYlUNI.mjs";
|
|
23
23
|
|
|
24
24
|
//#region src/utils/chronos-fn.ts
|
|
25
25
|
/**
|
|
@@ -640,46 +640,46 @@ var Chronos = class Chronos {
|
|
|
640
640
|
/**
|
|
641
641
|
* @instance Checks if another date is the same as this one in a specific unit.
|
|
642
642
|
* @param other The other date to compare.
|
|
643
|
-
* @param unit The unit to compare.
|
|
644
|
-
* @param weekStartsOn Optional: Day the week starts on (0 = Sunday, 1 = Monday).
|
|
643
|
+
* @param unit The unit to compare. Default is `'millisecond'`.
|
|
644
|
+
* @param weekStartsOn Optional: Day the week starts on (0 = Sunday, 1 = Monday). Default is `0`. Applicable when {@link unit} is `'week'`.
|
|
645
645
|
*/
|
|
646
|
-
isSame(other, unit, weekStartsOn = 0) {
|
|
646
|
+
isSame(other, unit = "millisecond", weekStartsOn = 0) {
|
|
647
647
|
return this.startOf(unit, weekStartsOn).#timestamp === Chronos.#cast(other).startOf(unit, weekStartsOn).#timestamp;
|
|
648
648
|
}
|
|
649
649
|
/**
|
|
650
650
|
* @instance Checks if this date is before another date in a specific unit.
|
|
651
651
|
* @param other The other date to compare.
|
|
652
|
-
* @param unit The unit to compare.
|
|
653
|
-
* @param weekStartsOn Optional: Day the week starts on (0 = Sunday, 1 = Monday).
|
|
652
|
+
* @param unit The unit to compare. Default is ``millisecond``.
|
|
653
|
+
* @param weekStartsOn Optional: Day the week starts on (0 = Sunday, 1 = Monday). Default is `0`. Applicable when {@link unit} is `'week'`.
|
|
654
654
|
*/
|
|
655
|
-
isBefore(other, unit, weekStartsOn = 0) {
|
|
655
|
+
isBefore(other, unit = "millisecond", weekStartsOn = 0) {
|
|
656
656
|
return this.startOf(unit, weekStartsOn).#timestamp < Chronos.#cast(other).startOf(unit, weekStartsOn).#timestamp;
|
|
657
657
|
}
|
|
658
658
|
/**
|
|
659
659
|
* @instance Checks if this date is after another date in a specific unit.
|
|
660
660
|
* @param other The other date to compare.
|
|
661
|
-
* @param unit The unit to compare.
|
|
662
|
-
* @param weekStartsOn Optional: Day the week starts on (0 = Sunday, 1 = Monday).
|
|
661
|
+
* @param unit The unit to compare. Default is `'millisecond'`.
|
|
662
|
+
* @param weekStartsOn Optional: Day the week starts on (0 = Sunday, 1 = Monday). Default is `0`. Applicable when {@link unit} is `'week'`.
|
|
663
663
|
*/
|
|
664
|
-
isAfter(other, unit, weekStartsOn = 0) {
|
|
664
|
+
isAfter(other, unit = "millisecond", weekStartsOn = 0) {
|
|
665
665
|
return this.startOf(unit, weekStartsOn).#timestamp > Chronos.#cast(other).startOf(unit, weekStartsOn).#timestamp;
|
|
666
666
|
}
|
|
667
667
|
/**
|
|
668
668
|
* @instance Checks if this date is the same or before another date in a specific unit.
|
|
669
669
|
* @param other The other date to compare.
|
|
670
|
-
* @param unit The unit to compare.
|
|
671
|
-
* @param weekStartsOn Optional: Day the week starts on (0 = Sunday, 1 = Monday).
|
|
670
|
+
* @param unit The unit to compare. Default is `'millisecond'`.
|
|
671
|
+
* @param weekStartsOn Optional: Day the week starts on (0 = Sunday, 1 = Monday). Default is `0`. Applicable when {@link unit} is `'week'`.
|
|
672
672
|
*/
|
|
673
|
-
isSameOrBefore(other, unit, weekStartsOn = 0) {
|
|
673
|
+
isSameOrBefore(other, unit = "millisecond", weekStartsOn = 0) {
|
|
674
674
|
return this.isSame(other, unit, weekStartsOn) || this.isBefore(other, unit, weekStartsOn);
|
|
675
675
|
}
|
|
676
676
|
/**
|
|
677
677
|
* @instance Checks if this date is the same or after another date in a specific unit.
|
|
678
678
|
* @param other The other date to compare.
|
|
679
|
-
* @param unit The unit to compare.
|
|
680
|
-
* @param weekStartsOn Optional: Day the week starts on (0 = Sunday, 1 = Monday).
|
|
679
|
+
* @param unit The unit to compare. Default is `'millisecond'`.
|
|
680
|
+
* @param weekStartsOn Optional: Day the week starts on (0 = Sunday, 1 = Monday). Default is `0`. Applicable when {@link unit} is `'week'`.
|
|
681
681
|
*/
|
|
682
|
-
isSameOrAfter(other, unit, weekStartsOn = 0) {
|
|
682
|
+
isSameOrAfter(other, unit = "millisecond", weekStartsOn = 0) {
|
|
683
683
|
return this.isSame(other, unit, weekStartsOn) || this.isAfter(other, unit, weekStartsOn);
|
|
684
684
|
}
|
|
685
685
|
/**
|
|
@@ -738,7 +738,7 @@ var Chronos = class Chronos {
|
|
|
738
738
|
/**
|
|
739
739
|
* @instance Returns a new `Chronos` instance at the start of a given unit.
|
|
740
740
|
* @param unit The unit to reset (e.g., year, month, day).
|
|
741
|
-
* @param weekStartsOn Optional: Day the week starts on (0 = Sunday, 1 = Monday).
|
|
741
|
+
* @param weekStartsOn Optional: Day the week starts on (0 = Sunday, 1 = Monday). Default is `0`. Applicable when {@link unit} is `'week'`.
|
|
742
742
|
*/
|
|
743
743
|
startOf(unit, weekStartsOn = 0) {
|
|
744
744
|
const d = new Date(this.#date);
|
|
@@ -776,7 +776,7 @@ var Chronos = class Chronos {
|
|
|
776
776
|
/**
|
|
777
777
|
* @instance Returns a new `Chronos` instance at the end of a given unit.
|
|
778
778
|
* @param unit The unit to adjust (e.g., year, month, day).
|
|
779
|
-
* @param weekStartsOn Optional: Day the week starts on (0 = Sunday, 1 = Monday).
|
|
779
|
+
* @param weekStartsOn Optional: Day the week starts on (0 = Sunday, 1 = Monday). Default is `0`. Applicable when {@link unit} is `'week'`.
|
|
780
780
|
*/
|
|
781
781
|
endOf(unit, weekStartsOn = 0) {
|
|
782
782
|
const instance = this.startOf(unit, weekStartsOn).add(1, unit).add(-1, "millisecond");
|
|
@@ -971,7 +971,7 @@ var Chronos = class Chronos {
|
|
|
971
971
|
}
|
|
972
972
|
/**
|
|
973
973
|
* @instance Calculates the week number of the year based on custom week start.
|
|
974
|
-
* @param weekStartsOn Optional: Day the week starts on (0 = Sunday, 1 = Monday).
|
|
974
|
+
* @param weekStartsOn Optional: Day the week starts on (0 = Sunday, 1 = Monday). Default is `0`. Applicable when {@link unit} is `'week'`.
|
|
975
975
|
* @returns Week number (1-53).
|
|
976
976
|
*/
|
|
977
977
|
getWeekOfYear(weekStartsOn = 0) {
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
//#region node_modules/.pnpm/nhb-toolbox@4.30.
|
|
17
|
+
//#region node_modules/.pnpm/nhb-toolbox@4.30.10/node_modules/nhb-toolbox/dist/esm/guards/non-primitives.js
|
|
18
18
|
function isArray(value) {
|
|
19
19
|
return Array.isArray(value);
|
|
20
20
|
}
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
|
|
18
|
-
//#region node_modules/.pnpm/nhb-toolbox@4.30.
|
|
18
|
+
//#region node_modules/.pnpm/nhb-toolbox@4.30.10/node_modules/nhb-toolbox/dist/esm/guards/non-primitives.js
|
|
19
19
|
function isArray(value) {
|
|
20
20
|
return Array.isArray(value);
|
|
21
21
|
}
|
|
@@ -16,11 +16,11 @@
|
|
|
16
16
|
|
|
17
17
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
18
18
|
const require_basic = require('../basic-DsQqC5nZ.cjs');
|
|
19
|
-
const require_primitives = require('../primitives-
|
|
20
|
-
const require_utilities = require('../utilities-
|
|
21
|
-
const require_helpers = require('../helpers-
|
|
19
|
+
const require_primitives = require('../primitives-DutXlR0D.cjs');
|
|
20
|
+
const require_utilities = require('../utilities-CkQA3Fkh.cjs');
|
|
21
|
+
const require_helpers = require('../helpers-D8yAKOsC.cjs');
|
|
22
22
|
|
|
23
|
-
//#region node_modules/.pnpm/nhb-toolbox@4.30.
|
|
23
|
+
//#region node_modules/.pnpm/nhb-toolbox@4.30.10/node_modules/nhb-toolbox/dist/esm/number/convert.js
|
|
24
24
|
function digitToBangla(digit, preserveNonDigit = true) {
|
|
25
25
|
const banglaDigits = Object.keys(require_utilities.BN_DIGITS);
|
|
26
26
|
const _matchAndConvert = (value) => {
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import { $t as
|
|
17
|
+
import { $t as BanglaDateOptions, Gt as $BanglaYear, Qt as BanglaDateObject, Ut as $BanglaMonth, Wt as $BanglaMonthDate, _n as StrictFormat, an as BnCalendarConfig, en as BanglaDayName, nn as BanglaMonthName, o as ChronosPlugin, qt as $BnEn, rn as BanglaSeasonName } from "../types-DgRC-2cA.cjs";
|
|
18
18
|
|
|
19
19
|
//#region src/plugins/banglaPlugin.d.ts
|
|
20
20
|
declare module 'chronos-date' {
|
|
@@ -236,6 +236,6 @@ declare module 'chronos-date' {
|
|
|
236
236
|
}
|
|
237
237
|
}
|
|
238
238
|
/** * Plugin to inject methods related to Bangla calendar system (`Bongabdo`) */
|
|
239
|
-
declare const banglaPlugin:
|
|
239
|
+
declare const banglaPlugin: ChronosPlugin;
|
|
240
240
|
//#endregion
|
|
241
241
|
export { banglaPlugin };
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import { $t as
|
|
17
|
+
import { $t as BanglaDateOptions, Gt as $BanglaYear, Qt as BanglaDateObject, Ut as $BanglaMonth, Wt as $BanglaMonthDate, _n as StrictFormat, an as BnCalendarConfig, en as BanglaDayName, nn as BanglaMonthName, o as ChronosPlugin, qt as $BnEn, rn as BanglaSeasonName } from "../types-Nd89nk1B.mjs";
|
|
18
18
|
|
|
19
19
|
//#region src/plugins/banglaPlugin.d.ts
|
|
20
20
|
declare module 'chronos-date' {
|
|
@@ -236,6 +236,6 @@ declare module 'chronos-date' {
|
|
|
236
236
|
}
|
|
237
237
|
}
|
|
238
238
|
/** * Plugin to inject methods related to Bangla calendar system (`Bongabdo`) */
|
|
239
|
-
declare const banglaPlugin:
|
|
239
|
+
declare const banglaPlugin: ChronosPlugin;
|
|
240
240
|
//#endregion
|
|
241
241
|
export { banglaPlugin };
|
|
@@ -15,11 +15,11 @@
|
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
import { n as BN_MONTHS, s as INTERNALS, t as BN_DAYS } from "../basic-DqKyujoj.mjs";
|
|
18
|
-
import { n as isNonEmptyString, r as isNumber } from "../primitives-
|
|
19
|
-
import { a as isNumericString, i as BN_DIGITS } from "../utilities-
|
|
20
|
-
import { a as _getBnSeason, d as _padShunno, i as _formatDateCore, l as _isBnLeapYear, o as _getBnYear, t as _bnDaysMonthIdx } from "../helpers-
|
|
18
|
+
import { n as isNonEmptyString, r as isNumber } from "../primitives-DpMa2dS2.mjs";
|
|
19
|
+
import { a as isNumericString, i as BN_DIGITS } from "../utilities-BfGFB7aw.mjs";
|
|
20
|
+
import { a as _getBnSeason, d as _padShunno, i as _formatDateCore, l as _isBnLeapYear, o as _getBnYear, t as _bnDaysMonthIdx } from "../helpers-eVQCueAC.mjs";
|
|
21
21
|
|
|
22
|
-
//#region node_modules/.pnpm/nhb-toolbox@4.30.
|
|
22
|
+
//#region node_modules/.pnpm/nhb-toolbox@4.30.10/node_modules/nhb-toolbox/dist/esm/number/convert.js
|
|
23
23
|
function digitToBangla(digit, preserveNonDigit = true) {
|
|
24
24
|
const banglaDigits = Object.keys(BN_DIGITS);
|
|
25
25
|
const _matchAndConvert = (value) => {
|
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
|
|
17
17
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
18
18
|
const require_basic = require('../basic-DsQqC5nZ.cjs');
|
|
19
|
-
const require_primitives = require('../primitives-
|
|
20
|
-
const require_non_primitives = require('../non-primitives-
|
|
19
|
+
const require_primitives = require('../primitives-DutXlR0D.cjs');
|
|
20
|
+
const require_non_primitives = require('../non-primitives-Dj558axv.cjs');
|
|
21
21
|
|
|
22
22
|
//#region src/plugins/businessPlugin.ts
|
|
23
23
|
/** * Plugin to inject `business` related methods */
|