bn-calendar 1.2.4 → 1.2.10
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 +46 -1557
- package/dist/{dist-BSh0fQzq.mjs → dist-C5OaVGq-.mjs} +7 -25
- package/dist/{dist-BasKGWW6.cjs → dist-DUk8hJtq.cjs} +6 -24
- package/dist/{object-D70hzkoY-JjxsmDJd.d.cts → index-RyvzOKVa-BA85h5wj.d.cts} +16 -64
- package/dist/{object-D70hzkoY-JjxsmDJd.d.mts → index-RyvzOKVa-BA85h5wj.d.mts} +16 -64
- package/dist/index.cjs +7 -6
- package/dist/index.d.cts +16 -8
- package/dist/index.d.mts +16 -8
- package/dist/index.mjs +7 -6
- package/dist/{types-CdJOp5Bk.d.mts → types-CaovKlY-.d.cts} +2 -18
- package/dist/{types-BKGg1Ls7.d.cts → types-HdT16D_P.d.mts} +2 -18
- package/dist/types.d.cts +3 -2
- package/dist/types.d.mts +3 -2
- package/dist/utils.cjs +1 -1
- package/dist/utils.d.cts +4 -13
- package/dist/utils.d.mts +4 -13
- package/dist/utils.mjs +1 -1
- package/package.json +21 -14
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
//#region node_modules/.pnpm/toolbox-x@
|
|
17
|
+
//#region node_modules/.pnpm/toolbox-x@2.6.16/node_modules/toolbox-x/dist/primitives-B-n6Y61s.mjs
|
|
18
18
|
/**
|
|
19
19
|
* Copyright 2026 - present Nazmul Hassan
|
|
20
20
|
*
|
|
@@ -64,7 +64,7 @@ function isNonEmptyString(value) {
|
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
//#endregion
|
|
67
|
-
//#region node_modules/.pnpm/toolbox-x@
|
|
67
|
+
//#region node_modules/.pnpm/toolbox-x@2.6.16/node_modules/toolbox-x/dist/constants-ZyfpysiQ.mjs
|
|
68
68
|
/** * Bangla digits from `০-৯` mapped against `0-9` */
|
|
69
69
|
const BN_DIGITS = /* @__PURE__ */ Object.freeze({
|
|
70
70
|
"০": 0,
|
|
@@ -80,7 +80,7 @@ const BN_DIGITS = /* @__PURE__ */ Object.freeze({
|
|
|
80
80
|
});
|
|
81
81
|
|
|
82
82
|
//#endregion
|
|
83
|
-
//#region node_modules/.pnpm/toolbox-x@
|
|
83
|
+
//#region node_modules/.pnpm/toolbox-x@2.6.16/node_modules/toolbox-x/dist/utilities-DH6-MgdV.mjs
|
|
84
84
|
/**
|
|
85
85
|
* Copyright 2026 - present Nazmul Hassan
|
|
86
86
|
*
|
|
@@ -127,7 +127,7 @@ function isObjectWithKeys(value, keys) {
|
|
|
127
127
|
* @returns `true` if the value is a valid date string, otherwise `false`.
|
|
128
128
|
*/
|
|
129
129
|
function isDateString(value) {
|
|
130
|
-
return isString(value) && !isNaN(Date.parse(value));
|
|
130
|
+
return isString(value) && !Number.isNaN(Date.parse(value));
|
|
131
131
|
}
|
|
132
132
|
/**
|
|
133
133
|
* * Type guard to check if a value is a string representing a finite number.
|
|
@@ -142,24 +142,6 @@ function isDateString(value) {
|
|
|
142
142
|
function isNumericString(value) {
|
|
143
143
|
return isString(value) && value?.trim() !== "" && Number.isFinite(Number(value));
|
|
144
144
|
}
|
|
145
|
-
|
|
146
|
-
//#endregion
|
|
147
|
-
//#region node_modules/.pnpm/toolbox-x@1.0.1-rc.6/node_modules/toolbox-x/dist/utilities-B9axOvOX.mjs
|
|
148
|
-
/**
|
|
149
|
-
* Copyright 2026 - present Nazmul Hassan
|
|
150
|
-
*
|
|
151
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
152
|
-
* you may not use this file except in compliance with the License.
|
|
153
|
-
* You may obtain a copy of the License at
|
|
154
|
-
*
|
|
155
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
156
|
-
*
|
|
157
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
158
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
159
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
160
|
-
* See the License for the specific language governing permissions and
|
|
161
|
-
* limitations under the License.
|
|
162
|
-
*/
|
|
163
145
|
/**
|
|
164
146
|
* * Normalize a number or numeric string to a number.
|
|
165
147
|
* @description
|
|
@@ -173,7 +155,7 @@ function normalizeNumber(num) {
|
|
|
173
155
|
}
|
|
174
156
|
|
|
175
157
|
//#endregion
|
|
176
|
-
//#region node_modules/.pnpm/toolbox-x@
|
|
158
|
+
//#region node_modules/.pnpm/toolbox-x@2.6.16/node_modules/toolbox-x/dist/index.mjs
|
|
177
159
|
/**
|
|
178
160
|
* Copyright 2026 - present Nazmul Hassan
|
|
179
161
|
*
|
|
@@ -214,7 +196,7 @@ function normalizeNumber(num) {
|
|
|
214
196
|
function banglaToDigit(bnDigit, forceNumber = true) {
|
|
215
197
|
if (!isNonEmptyString(bnDigit)) return forceNumber ? NaN : "";
|
|
216
198
|
const digitStr = bnDigit.replace(/[০১২৩৪৫৬৭৮৯]/g, (d) => String(BN_DIGITS[d]));
|
|
217
|
-
if (forceNumber) return Number(digitStr.split("").filter((dig) => !isNaN(Number(dig))).join(""));
|
|
199
|
+
if (forceNumber) return Number(digitStr.split("").filter((dig) => !Number.isNaN(Number(dig))).join(""));
|
|
218
200
|
return digitStr;
|
|
219
201
|
}
|
|
220
202
|
/**
|
|
@@ -252,4 +234,4 @@ function digitToBangla(digit, preserveNonDigit = true) {
|
|
|
252
234
|
}
|
|
253
235
|
|
|
254
236
|
//#endregion
|
|
255
|
-
export {
|
|
237
|
+
export { normalizeNumber as a, isNumber as c, isObjectWithKeys as i, digitToBangla as n, isInteger as o, isDateString as r, isNonEmptyString as s, banglaToDigit as t };
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
|
|
18
|
-
//#region node_modules/.pnpm/toolbox-x@
|
|
18
|
+
//#region node_modules/.pnpm/toolbox-x@2.6.16/node_modules/toolbox-x/dist/primitives-B-n6Y61s.mjs
|
|
19
19
|
/**
|
|
20
20
|
* Copyright 2026 - present Nazmul Hassan
|
|
21
21
|
*
|
|
@@ -65,7 +65,7 @@ function isNonEmptyString(value) {
|
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
//#endregion
|
|
68
|
-
//#region node_modules/.pnpm/toolbox-x@
|
|
68
|
+
//#region node_modules/.pnpm/toolbox-x@2.6.16/node_modules/toolbox-x/dist/constants-ZyfpysiQ.mjs
|
|
69
69
|
/** * Bangla digits from `০-৯` mapped against `0-9` */
|
|
70
70
|
const BN_DIGITS = /* @__PURE__ */ Object.freeze({
|
|
71
71
|
"০": 0,
|
|
@@ -81,7 +81,7 @@ const BN_DIGITS = /* @__PURE__ */ Object.freeze({
|
|
|
81
81
|
});
|
|
82
82
|
|
|
83
83
|
//#endregion
|
|
84
|
-
//#region node_modules/.pnpm/toolbox-x@
|
|
84
|
+
//#region node_modules/.pnpm/toolbox-x@2.6.16/node_modules/toolbox-x/dist/utilities-DH6-MgdV.mjs
|
|
85
85
|
/**
|
|
86
86
|
* Copyright 2026 - present Nazmul Hassan
|
|
87
87
|
*
|
|
@@ -128,7 +128,7 @@ function isObjectWithKeys(value, keys) {
|
|
|
128
128
|
* @returns `true` if the value is a valid date string, otherwise `false`.
|
|
129
129
|
*/
|
|
130
130
|
function isDateString(value) {
|
|
131
|
-
return isString(value) && !isNaN(Date.parse(value));
|
|
131
|
+
return isString(value) && !Number.isNaN(Date.parse(value));
|
|
132
132
|
}
|
|
133
133
|
/**
|
|
134
134
|
* * Type guard to check if a value is a string representing a finite number.
|
|
@@ -143,24 +143,6 @@ function isDateString(value) {
|
|
|
143
143
|
function isNumericString(value) {
|
|
144
144
|
return isString(value) && value?.trim() !== "" && Number.isFinite(Number(value));
|
|
145
145
|
}
|
|
146
|
-
|
|
147
|
-
//#endregion
|
|
148
|
-
//#region node_modules/.pnpm/toolbox-x@1.0.1-rc.6/node_modules/toolbox-x/dist/utilities-B9axOvOX.mjs
|
|
149
|
-
/**
|
|
150
|
-
* Copyright 2026 - present Nazmul Hassan
|
|
151
|
-
*
|
|
152
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
153
|
-
* you may not use this file except in compliance with the License.
|
|
154
|
-
* You may obtain a copy of the License at
|
|
155
|
-
*
|
|
156
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
157
|
-
*
|
|
158
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
159
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
160
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
161
|
-
* See the License for the specific language governing permissions and
|
|
162
|
-
* limitations under the License.
|
|
163
|
-
*/
|
|
164
146
|
/**
|
|
165
147
|
* * Normalize a number or numeric string to a number.
|
|
166
148
|
* @description
|
|
@@ -174,7 +156,7 @@ function normalizeNumber(num) {
|
|
|
174
156
|
}
|
|
175
157
|
|
|
176
158
|
//#endregion
|
|
177
|
-
//#region node_modules/.pnpm/toolbox-x@
|
|
159
|
+
//#region node_modules/.pnpm/toolbox-x@2.6.16/node_modules/toolbox-x/dist/index.mjs
|
|
178
160
|
/**
|
|
179
161
|
* Copyright 2026 - present Nazmul Hassan
|
|
180
162
|
*
|
|
@@ -215,7 +197,7 @@ function normalizeNumber(num) {
|
|
|
215
197
|
function banglaToDigit(bnDigit, forceNumber = true) {
|
|
216
198
|
if (!isNonEmptyString(bnDigit)) return forceNumber ? NaN : "";
|
|
217
199
|
const digitStr = bnDigit.replace(/[০১২৩৪৫৬৭৮৯]/g, (d) => String(BN_DIGITS[d]));
|
|
218
|
-
if (forceNumber) return Number(digitStr.split("").filter((dig) => !isNaN(Number(dig))).join(""));
|
|
200
|
+
if (forceNumber) return Number(digitStr.split("").filter((dig) => !Number.isNaN(Number(dig))).join(""));
|
|
219
201
|
return digitStr;
|
|
220
202
|
}
|
|
221
203
|
/**
|
|
@@ -14,43 +14,24 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
//#region node_modules/.pnpm/toolbox-x@
|
|
17
|
+
//#region node_modules/.pnpm/toolbox-x@2.6.16/node_modules/toolbox-x/dist/index-RyvzOKVa.d.mts
|
|
18
18
|
declare const YEAR_FORMATS: readonly ["YYYY", "YY", "yyyy", "yy"];
|
|
19
19
|
declare const MONTH_FORMATS: readonly ["M", "MM", "mmm", "mmmm"];
|
|
20
20
|
declare const DATE_FORMATS: readonly ["DD", "D", "Do"];
|
|
21
21
|
declare const DAY_FORMATS: readonly ["d", "dd", "ddd"];
|
|
22
22
|
/** * Bangla digits from `০-৯` mapped against `0-9` */
|
|
23
23
|
declare const BN_DIGITS: Readonly<{
|
|
24
|
-
readonly '
|
|
25
|
-
readonly '
|
|
26
|
-
readonly '
|
|
27
|
-
readonly '
|
|
28
|
-
readonly '
|
|
29
|
-
readonly '
|
|
30
|
-
readonly '
|
|
31
|
-
readonly '
|
|
32
|
-
readonly '
|
|
33
|
-
readonly '
|
|
34
|
-
}>;
|
|
35
|
-
//#region src/number/Unit.d.ts
|
|
36
|
-
/**
|
|
37
|
-
* @class Class to handle conversions between various types of units.
|
|
38
|
-
*
|
|
39
|
-
* Includes static methods for:
|
|
40
|
-
* - Length: meters, feet, kilometers, miles
|
|
41
|
-
* - Mass: kilograms, pounds, grams, ounces
|
|
42
|
-
* - Temperature: Celsius, Fahrenheit, Kelvin
|
|
43
|
-
* - Volume: liters, gallons
|
|
44
|
-
* - Area: square meters, square feet
|
|
45
|
-
* - Speed: km/h, mph
|
|
46
|
-
* - Time: hours, minutes, seconds, days
|
|
47
|
-
* - Digital Storage: kilobytes, megabytes, gigabytes
|
|
48
|
-
* - Energy: joules, calories
|
|
49
|
-
* - Pressure: atm, pascals
|
|
50
|
-
* - Frequency: Hz, kHz
|
|
51
|
-
*
|
|
52
|
-
* @remarks For more robust unit conversion, please use the `Converter` function which provides category-specific conversion classes.
|
|
53
|
-
*/
|
|
24
|
+
readonly '০': 0;
|
|
25
|
+
readonly '১': 1;
|
|
26
|
+
readonly '২': 2;
|
|
27
|
+
readonly '৩': 3;
|
|
28
|
+
readonly '৪': 4;
|
|
29
|
+
readonly '৫': 5;
|
|
30
|
+
readonly '৬': 6;
|
|
31
|
+
readonly '৭': 7;
|
|
32
|
+
readonly '৮': 8;
|
|
33
|
+
readonly '৯': 9;
|
|
34
|
+
}>;
|
|
54
35
|
/**
|
|
55
36
|
* * Broadens a literal union (typically `string` or `number`) to also accept any other value of the base type, without losing IntelliSense autocomplete for the provided literals.
|
|
56
37
|
*
|
|
@@ -76,20 +57,11 @@ declare const BN_DIGITS: Readonly<{
|
|
|
76
57
|
*
|
|
77
58
|
* @note Technically, this uses intersection with primitive base types (`string & {}` or `number & {}`) to retain IntelliSense while avoiding type narrowing.
|
|
78
59
|
*/
|
|
79
|
-
type LooseLiteral<T
|
|
80
|
-
/**
|
|
81
|
-
|
|
82
|
-
*
|
|
83
|
-
* @typeParam T - The original object type
|
|
84
|
-
* @returns A new object type with only optional keys from `T`
|
|
85
|
-
* @example
|
|
86
|
-
* type Example = { a: string; b?: number; c?: boolean };
|
|
87
|
-
* type OptionalPart = ExtractOptional<Example>;
|
|
88
|
-
* // { b?: number; c?: boolean }
|
|
89
|
-
*/
|
|
60
|
+
type LooseLiteral<T> = T | $LooseLiteral<T>;
|
|
61
|
+
/** Helper type to create loose `string`/`number` part of {@link LooseLiteral} */
|
|
62
|
+
type $LooseLiteral<T> = T extends string ? string & {} : T extends number ? number & {} : never;
|
|
90
63
|
/** * Build a tuple of given length (helper for type-level arithmetic). */
|
|
91
64
|
type $BuildTuple<L extends number, T extends unknown[] = []> = T['length'] extends L ? T : $BuildTuple<L, [...T, unknown]>;
|
|
92
|
-
/** * Produce a union of numbers `From | From+1 | ... | To`. */
|
|
93
65
|
/**
|
|
94
66
|
* Recursively join the string S for each element in the tuple A.
|
|
95
67
|
* Returns an empty string for an empty tuple.
|
|
@@ -108,21 +80,6 @@ type $JoinRepeat<S extends string, A extends unknown[]> = A extends [unknown, ..
|
|
|
108
80
|
* - If `S` is a union (e.g. 'a' | 'b'), the resulting union grows exponentially with `N`.
|
|
109
81
|
*/
|
|
110
82
|
type Repeat<S extends string, N extends number> = $JoinRepeat<S, $BuildTuple<N>>;
|
|
111
|
-
/**
|
|
112
|
-
* * Replace all occurrences of substring `Search` in `Str` with `With`.
|
|
113
|
-
*
|
|
114
|
-
* @example
|
|
115
|
-
* type Dash = Replace<'hello world', ' ', '-'>; // "hello-world"
|
|
116
|
-
*
|
|
117
|
-
* type Underscore = Replace<'a-b-c', '-', '_'>; // "a_b_c"
|
|
118
|
-
*
|
|
119
|
-
* type NoSpaces = Replace<' spaced out ', ' ', ''>; // "spacedout"
|
|
120
|
-
*
|
|
121
|
-
* @remarks **Notes:**
|
|
122
|
-
* - Works recursively to replace **all** occurrences of `Search`.
|
|
123
|
-
* - If `Search` does not exist in `Str`, returns `Str` unchanged.
|
|
124
|
-
* - `Str`, `Search` (Default is space `" "`) and `With` (Default is `"-"`) must be literal string types.
|
|
125
|
-
*/
|
|
126
83
|
//#endregion
|
|
127
84
|
//#region src/types/number.d.ts
|
|
128
85
|
/** Enumerate & Enumerate Internal: builds a union of all numbers from 0 to N - 1 */
|
|
@@ -157,15 +114,12 @@ type $AddOne<N extends number, Acc extends unknown[] = []> = Acc['length'] exten
|
|
|
157
114
|
* @returns A union of numeric literal types from `From` to `To - 1`.
|
|
158
115
|
*/
|
|
159
116
|
type NumberRange<From extends number, To extends number> = Exclude<Enumerate<$AddOne<To>>, Enumerate<From>>;
|
|
160
|
-
/** - Number value in percentage `(0% - 100%)` without `%` symbol. */
|
|
161
117
|
/** Bangla digits from `০-৯` */
|
|
162
118
|
type BanglaDigit = keyof typeof BN_DIGITS;
|
|
163
119
|
/** Bangla digits from `১-৯` */
|
|
164
120
|
type $BnOnes = Exclude<BanglaDigit, '০'>;
|
|
165
121
|
/** Result type for Bangla digit conversion based on `force` flag */
|
|
166
|
-
type BnDigitResult<Force extends boolean> = Force extends true ? number : string;
|
|
167
|
-
//#region src/types/date.d.ts
|
|
168
|
-
/** - Minute in numeric string from `00` to `23` */
|
|
122
|
+
type BnDigitResult<Force extends boolean> = Force extends true ? number : string;
|
|
169
123
|
/** Year in either 4 or 2 digits format */
|
|
170
124
|
type YearToken = (typeof YEAR_FORMATS)[number];
|
|
171
125
|
/** Month in either 1 or 2 digits or 3 letters or full word format */
|
|
@@ -174,9 +128,7 @@ type MonthToken = (typeof MONTH_FORMATS)[number];
|
|
|
174
128
|
type DayToken = (typeof DAY_FORMATS)[number];
|
|
175
129
|
/** Date in either 1 or 2 digits format */
|
|
176
130
|
type DateToken = (typeof DATE_FORMATS)[number];
|
|
177
|
-
/** Second in either 1 or 2 digits format */
|
|
178
131
|
/** Standard date formats. */
|
|
179
132
|
type DateFormatToken = `${DateToken} ${Exclude<MonthToken, 'M' | 'MM'>}` | `${Exclude<MonthToken, 'M' | 'MM'>} ${DateToken}` | `${DayToken}, ${DateToken} ${Exclude<MonthToken, 'M' | 'MM'>}` | `${DayToken}, ${Exclude<MonthToken, 'M' | 'MM'>} ${DateToken}` | `${Exclude<MonthToken, 'M' | 'MM'>} ${DateToken}, ${YearToken}` | `${DateToken} ${Exclude<MonthToken, 'M' | 'MM'>}, ${YearToken}` | `${Exclude<MonthToken, 'M' | 'MM'>} ${DateToken} ${YearToken}` | `${DateToken} ${Exclude<MonthToken, 'M' | 'MM'>} ${YearToken}` | `${DayToken}, ${Exclude<MonthToken, 'M' | 'MM'>} ${DateToken}, ${YearToken}` | `${DayToken}, ${DateToken} ${Exclude<MonthToken, 'M' | 'MM'>}, ${YearToken}` | `${DayToken}, ${Exclude<MonthToken, 'M' | 'MM'>} ${DateToken} ${YearToken}` | `${DayToken}, ${DateToken} ${Exclude<MonthToken, 'M' | 'MM'>} ${YearToken}` | `${Exclude<DateToken, 'Do'>}.${Exclude<MonthToken, 'mmm' | 'mmmm'>}.${YearToken}` | `${YearToken}.${Exclude<MonthToken, 'mmm' | 'mmmm'>}.${Exclude<DateToken, 'Do'>}` | `${Exclude<DateToken, 'Do'>}/${Exclude<MonthToken, 'mmm' | 'mmmm'>}/${YearToken}` | `${Exclude<DateToken, 'Do'>}-${Exclude<MonthToken, 'mmm' | 'mmmm'>}-${YearToken}` | `${Exclude<MonthToken, 'mmm' | 'mmmm'>}/${Exclude<DateToken, 'Do'>}/${YearToken}` | `${Exclude<MonthToken, 'mmm' | 'mmmm'>}-${Exclude<DateToken, 'Do'>}-${YearToken}` | `${YearToken}-${Exclude<MonthToken, 'mmm' | 'mmmm'>}-${Exclude<DateToken, 'Do'>}` | `${YearToken}/${Exclude<MonthToken, 'mmm' | 'mmmm'>}/${Exclude<DateToken, 'Do'>}` | `${YearToken}-${Exclude<DateToken, 'Do'>}-${Exclude<MonthToken, 'mmm' | 'mmmm'>}` | `${YearToken}/${Exclude<DateToken, 'Do'>}/${Exclude<MonthToken, 'mmm' | 'mmmm'>}`;
|
|
180
|
-
/** Standard Time Formats */
|
|
181
133
|
//#endregion
|
|
182
134
|
export { Enumerate as a, Repeat as c, DateFormatToken as i, BanglaDigit as n, LooseLiteral as o, BnDigitResult as r, NumberRange as s, $BnOnes as t };
|
|
@@ -14,43 +14,24 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
//#region node_modules/.pnpm/toolbox-x@
|
|
17
|
+
//#region node_modules/.pnpm/toolbox-x@2.6.16/node_modules/toolbox-x/dist/index-RyvzOKVa.d.mts
|
|
18
18
|
declare const YEAR_FORMATS: readonly ["YYYY", "YY", "yyyy", "yy"];
|
|
19
19
|
declare const MONTH_FORMATS: readonly ["M", "MM", "mmm", "mmmm"];
|
|
20
20
|
declare const DATE_FORMATS: readonly ["DD", "D", "Do"];
|
|
21
21
|
declare const DAY_FORMATS: readonly ["d", "dd", "ddd"];
|
|
22
22
|
/** * Bangla digits from `০-৯` mapped against `0-9` */
|
|
23
23
|
declare const BN_DIGITS: Readonly<{
|
|
24
|
-
readonly '
|
|
25
|
-
readonly '
|
|
26
|
-
readonly '
|
|
27
|
-
readonly '
|
|
28
|
-
readonly '
|
|
29
|
-
readonly '
|
|
30
|
-
readonly '
|
|
31
|
-
readonly '
|
|
32
|
-
readonly '
|
|
33
|
-
readonly '
|
|
34
|
-
}>;
|
|
35
|
-
//#region src/number/Unit.d.ts
|
|
36
|
-
/**
|
|
37
|
-
* @class Class to handle conversions between various types of units.
|
|
38
|
-
*
|
|
39
|
-
* Includes static methods for:
|
|
40
|
-
* - Length: meters, feet, kilometers, miles
|
|
41
|
-
* - Mass: kilograms, pounds, grams, ounces
|
|
42
|
-
* - Temperature: Celsius, Fahrenheit, Kelvin
|
|
43
|
-
* - Volume: liters, gallons
|
|
44
|
-
* - Area: square meters, square feet
|
|
45
|
-
* - Speed: km/h, mph
|
|
46
|
-
* - Time: hours, minutes, seconds, days
|
|
47
|
-
* - Digital Storage: kilobytes, megabytes, gigabytes
|
|
48
|
-
* - Energy: joules, calories
|
|
49
|
-
* - Pressure: atm, pascals
|
|
50
|
-
* - Frequency: Hz, kHz
|
|
51
|
-
*
|
|
52
|
-
* @remarks For more robust unit conversion, please use the `Converter` function which provides category-specific conversion classes.
|
|
53
|
-
*/
|
|
24
|
+
readonly '০': 0;
|
|
25
|
+
readonly '১': 1;
|
|
26
|
+
readonly '২': 2;
|
|
27
|
+
readonly '৩': 3;
|
|
28
|
+
readonly '৪': 4;
|
|
29
|
+
readonly '৫': 5;
|
|
30
|
+
readonly '৬': 6;
|
|
31
|
+
readonly '৭': 7;
|
|
32
|
+
readonly '৮': 8;
|
|
33
|
+
readonly '৯': 9;
|
|
34
|
+
}>;
|
|
54
35
|
/**
|
|
55
36
|
* * Broadens a literal union (typically `string` or `number`) to also accept any other value of the base type, without losing IntelliSense autocomplete for the provided literals.
|
|
56
37
|
*
|
|
@@ -76,20 +57,11 @@ declare const BN_DIGITS: Readonly<{
|
|
|
76
57
|
*
|
|
77
58
|
* @note Technically, this uses intersection with primitive base types (`string & {}` or `number & {}`) to retain IntelliSense while avoiding type narrowing.
|
|
78
59
|
*/
|
|
79
|
-
type LooseLiteral<T
|
|
80
|
-
/**
|
|
81
|
-
|
|
82
|
-
*
|
|
83
|
-
* @typeParam T - The original object type
|
|
84
|
-
* @returns A new object type with only optional keys from `T`
|
|
85
|
-
* @example
|
|
86
|
-
* type Example = { a: string; b?: number; c?: boolean };
|
|
87
|
-
* type OptionalPart = ExtractOptional<Example>;
|
|
88
|
-
* // { b?: number; c?: boolean }
|
|
89
|
-
*/
|
|
60
|
+
type LooseLiteral<T> = T | $LooseLiteral<T>;
|
|
61
|
+
/** Helper type to create loose `string`/`number` part of {@link LooseLiteral} */
|
|
62
|
+
type $LooseLiteral<T> = T extends string ? string & {} : T extends number ? number & {} : never;
|
|
90
63
|
/** * Build a tuple of given length (helper for type-level arithmetic). */
|
|
91
64
|
type $BuildTuple<L extends number, T extends unknown[] = []> = T['length'] extends L ? T : $BuildTuple<L, [...T, unknown]>;
|
|
92
|
-
/** * Produce a union of numbers `From | From+1 | ... | To`. */
|
|
93
65
|
/**
|
|
94
66
|
* Recursively join the string S for each element in the tuple A.
|
|
95
67
|
* Returns an empty string for an empty tuple.
|
|
@@ -108,21 +80,6 @@ type $JoinRepeat<S extends string, A extends unknown[]> = A extends [unknown, ..
|
|
|
108
80
|
* - If `S` is a union (e.g. 'a' | 'b'), the resulting union grows exponentially with `N`.
|
|
109
81
|
*/
|
|
110
82
|
type Repeat<S extends string, N extends number> = $JoinRepeat<S, $BuildTuple<N>>;
|
|
111
|
-
/**
|
|
112
|
-
* * Replace all occurrences of substring `Search` in `Str` with `With`.
|
|
113
|
-
*
|
|
114
|
-
* @example
|
|
115
|
-
* type Dash = Replace<'hello world', ' ', '-'>; // "hello-world"
|
|
116
|
-
*
|
|
117
|
-
* type Underscore = Replace<'a-b-c', '-', '_'>; // "a_b_c"
|
|
118
|
-
*
|
|
119
|
-
* type NoSpaces = Replace<' spaced out ', ' ', ''>; // "spacedout"
|
|
120
|
-
*
|
|
121
|
-
* @remarks **Notes:**
|
|
122
|
-
* - Works recursively to replace **all** occurrences of `Search`.
|
|
123
|
-
* - If `Search` does not exist in `Str`, returns `Str` unchanged.
|
|
124
|
-
* - `Str`, `Search` (Default is space `" "`) and `With` (Default is `"-"`) must be literal string types.
|
|
125
|
-
*/
|
|
126
83
|
//#endregion
|
|
127
84
|
//#region src/types/number.d.ts
|
|
128
85
|
/** Enumerate & Enumerate Internal: builds a union of all numbers from 0 to N - 1 */
|
|
@@ -157,15 +114,12 @@ type $AddOne<N extends number, Acc extends unknown[] = []> = Acc['length'] exten
|
|
|
157
114
|
* @returns A union of numeric literal types from `From` to `To - 1`.
|
|
158
115
|
*/
|
|
159
116
|
type NumberRange<From extends number, To extends number> = Exclude<Enumerate<$AddOne<To>>, Enumerate<From>>;
|
|
160
|
-
/** - Number value in percentage `(0% - 100%)` without `%` symbol. */
|
|
161
117
|
/** Bangla digits from `০-৯` */
|
|
162
118
|
type BanglaDigit = keyof typeof BN_DIGITS;
|
|
163
119
|
/** Bangla digits from `১-৯` */
|
|
164
120
|
type $BnOnes = Exclude<BanglaDigit, '০'>;
|
|
165
121
|
/** Result type for Bangla digit conversion based on `force` flag */
|
|
166
|
-
type BnDigitResult<Force extends boolean> = Force extends true ? number : string;
|
|
167
|
-
//#region src/types/date.d.ts
|
|
168
|
-
/** - Minute in numeric string from `00` to `23` */
|
|
122
|
+
type BnDigitResult<Force extends boolean> = Force extends true ? number : string;
|
|
169
123
|
/** Year in either 4 or 2 digits format */
|
|
170
124
|
type YearToken = (typeof YEAR_FORMATS)[number];
|
|
171
125
|
/** Month in either 1 or 2 digits or 3 letters or full word format */
|
|
@@ -174,9 +128,7 @@ type MonthToken = (typeof MONTH_FORMATS)[number];
|
|
|
174
128
|
type DayToken = (typeof DAY_FORMATS)[number];
|
|
175
129
|
/** Date in either 1 or 2 digits format */
|
|
176
130
|
type DateToken = (typeof DATE_FORMATS)[number];
|
|
177
|
-
/** Second in either 1 or 2 digits format */
|
|
178
131
|
/** Standard date formats. */
|
|
179
132
|
type DateFormatToken = `${DateToken} ${Exclude<MonthToken, 'M' | 'MM'>}` | `${Exclude<MonthToken, 'M' | 'MM'>} ${DateToken}` | `${DayToken}, ${DateToken} ${Exclude<MonthToken, 'M' | 'MM'>}` | `${DayToken}, ${Exclude<MonthToken, 'M' | 'MM'>} ${DateToken}` | `${Exclude<MonthToken, 'M' | 'MM'>} ${DateToken}, ${YearToken}` | `${DateToken} ${Exclude<MonthToken, 'M' | 'MM'>}, ${YearToken}` | `${Exclude<MonthToken, 'M' | 'MM'>} ${DateToken} ${YearToken}` | `${DateToken} ${Exclude<MonthToken, 'M' | 'MM'>} ${YearToken}` | `${DayToken}, ${Exclude<MonthToken, 'M' | 'MM'>} ${DateToken}, ${YearToken}` | `${DayToken}, ${DateToken} ${Exclude<MonthToken, 'M' | 'MM'>}, ${YearToken}` | `${DayToken}, ${Exclude<MonthToken, 'M' | 'MM'>} ${DateToken} ${YearToken}` | `${DayToken}, ${DateToken} ${Exclude<MonthToken, 'M' | 'MM'>} ${YearToken}` | `${Exclude<DateToken, 'Do'>}.${Exclude<MonthToken, 'mmm' | 'mmmm'>}.${YearToken}` | `${YearToken}.${Exclude<MonthToken, 'mmm' | 'mmmm'>}.${Exclude<DateToken, 'Do'>}` | `${Exclude<DateToken, 'Do'>}/${Exclude<MonthToken, 'mmm' | 'mmmm'>}/${YearToken}` | `${Exclude<DateToken, 'Do'>}-${Exclude<MonthToken, 'mmm' | 'mmmm'>}-${YearToken}` | `${Exclude<MonthToken, 'mmm' | 'mmmm'>}/${Exclude<DateToken, 'Do'>}/${YearToken}` | `${Exclude<MonthToken, 'mmm' | 'mmmm'>}-${Exclude<DateToken, 'Do'>}-${YearToken}` | `${YearToken}-${Exclude<MonthToken, 'mmm' | 'mmmm'>}-${Exclude<DateToken, 'Do'>}` | `${YearToken}/${Exclude<MonthToken, 'mmm' | 'mmmm'>}/${Exclude<DateToken, 'Do'>}` | `${YearToken}-${Exclude<DateToken, 'Do'>}-${Exclude<MonthToken, 'mmm' | 'mmmm'>}` | `${YearToken}/${Exclude<DateToken, 'Do'>}/${Exclude<MonthToken, 'mmm' | 'mmmm'>}`;
|
|
180
|
-
/** Standard Time Formats */
|
|
181
133
|
//#endregion
|
|
182
134
|
export { Enumerate as a, Repeat as c, DateFormatToken as i, BanglaDigit as n, LooseLiteral as o, BnDigitResult as r, NumberRange as s, $BnOnes as t };
|
package/dist/index.cjs
CHANGED
|
@@ -15,9 +15,9 @@
|
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
18
|
-
const require_dist = require('./dist-
|
|
18
|
+
const require_dist = require('./dist-DUk8hJtq.cjs');
|
|
19
19
|
|
|
20
|
-
//#region node_modules/.pnpm/toolbox-x@
|
|
20
|
+
//#region node_modules/.pnpm/toolbox-x@2.6.16/node_modules/toolbox-x/dist/guards-CV5StNcy.mjs
|
|
21
21
|
/**
|
|
22
22
|
* * Checks if the year is a leap year.
|
|
23
23
|
*
|
|
@@ -279,7 +279,7 @@ const SORTED_TIME_FORMATS = /* @__PURE__ */ Object.freeze([
|
|
|
279
279
|
|
|
280
280
|
//#endregion
|
|
281
281
|
//#region src/helpers.ts
|
|
282
|
-
/** Core formatting logic shared by `
|
|
282
|
+
/** Core formatting logic shared by `BanglaCalendar` and possible future implementation */
|
|
283
283
|
function _formatDateCore(format, dateComponents) {
|
|
284
284
|
const tokenRegex = new RegExp(`^(${SORTED_TIME_FORMATS.join("|")})`);
|
|
285
285
|
let result = "";
|
|
@@ -417,7 +417,7 @@ var BanglaCalendar = class BanglaCalendar {
|
|
|
417
417
|
constructor(dateBnYrOrCfg, bnMonthOrCfg, bnDateOrCfg, config) {
|
|
418
418
|
this.variant = this.#processVariants(dateBnYrOrCfg, bnMonthOrCfg, bnDateOrCfg, config);
|
|
419
419
|
let date = dateBnYrOrCfg instanceof Date ? dateBnYrOrCfg : new Date(require_dist.isDateString(dateBnYrOrCfg) && !BanglaCalendar.isBanglaDateString(dateBnYrOrCfg) ? dateBnYrOrCfg : require_dist.isNumber(dateBnYrOrCfg) && !BanglaCalendar.isBanglaYearEn(dateBnYrOrCfg) ? dateBnYrOrCfg : Date.now());
|
|
420
|
-
if (isNaN(date.getTime())) date = /* @__PURE__ */ new Date();
|
|
420
|
+
if (Number.isNaN(date.getTime())) date = /* @__PURE__ */ new Date();
|
|
421
421
|
const { year, month, monthDate } = this.#processDate(date);
|
|
422
422
|
let bnYear = BanglaCalendar.isBanglaYear(dateBnYrOrCfg) ? require_dist.banglaToDigit(dateBnYrOrCfg) : require_dist.isNumber(dateBnYrOrCfg) && BanglaCalendar.isBanglaYearEn(dateBnYrOrCfg) ? dateBnYrOrCfg : year;
|
|
423
423
|
let bnMonth = BanglaCalendar.isBanglaMonth(bnMonthOrCfg) ? require_dist.banglaToDigit(bnMonthOrCfg) : BanglaCalendar.isBanglaMonthEn(bnMonthOrCfg) ? bnMonthOrCfg : month;
|
|
@@ -939,7 +939,7 @@ var BanglaCalendar = class BanglaCalendar {
|
|
|
939
939
|
DD: _padShunno(date.bn),
|
|
940
940
|
Do: date.bn,
|
|
941
941
|
S: seasonName,
|
|
942
|
-
SS: seasonName
|
|
942
|
+
SS: `${seasonName}কাল`
|
|
943
943
|
};
|
|
944
944
|
return _formatDateCore(format || "ddd, DD mmmm (SS), YYYY বঙ্গাব্দ", dateComponents);
|
|
945
945
|
}
|
|
@@ -975,7 +975,8 @@ var BanglaCalendar = class BanglaCalendar {
|
|
|
975
975
|
#getClampedBnCal(tyBn, tmBn, cdBn, variant) {
|
|
976
976
|
const { gregYear } = this.#processGregYear(tyBn, tmBn);
|
|
977
977
|
const { bnMonthTable } = this.#getBnMonthTableLeap(gregYear, tyBn);
|
|
978
|
-
|
|
978
|
+
const tdBn = Math.min(cdBn, bnMonthTable[tmBn - 1]);
|
|
979
|
+
return new BanglaCalendar(tyBn, tmBn, tdBn, { variant });
|
|
979
980
|
}
|
|
980
981
|
/** Process variant from the config */
|
|
981
982
|
#processVariants(v1, v2, v3, v4) {
|
package/dist/index.d.cts
CHANGED
|
@@ -14,9 +14,8 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import { a as Enumerate, s as NumberRange } from "./
|
|
18
|
-
import {
|
|
19
|
-
|
|
17
|
+
import { a as Enumerate, s as NumberRange } from "./index-RyvzOKVa-BA85h5wj.cjs";
|
|
18
|
+
import { a as $BnEn, c as BanglaDate, d as BanglaMonth, f as BanglaMonthName, g as BnCalendarVariant, h as BnCalendarConfig, l as BanglaDateFormat, m as BanglaYear, p as BanglaSeasonName, u as BanglaDayName } from "./types-CaovKlY-.cjs";
|
|
20
19
|
//#region src/BanglaCalendar.d.ts
|
|
21
20
|
/**
|
|
22
21
|
* @class Represents a date in the Bangla calendar system with support for different variants.
|
|
@@ -53,23 +52,32 @@ declare class BanglaCalendar {
|
|
|
53
52
|
readonly variant: BnCalendarVariant;
|
|
54
53
|
/** Bangla year */
|
|
55
54
|
readonly year: Readonly<{
|
|
56
|
-
/** Bangla year in Bangla digit */
|
|
55
|
+
/** Bangla year in Bangla digit */
|
|
56
|
+
bn: BanglaYear;
|
|
57
|
+
/** Bangla year in Latin digit */
|
|
57
58
|
en: number;
|
|
58
59
|
}>;
|
|
59
60
|
/** Bangla month */
|
|
60
61
|
readonly month: Readonly<{
|
|
61
|
-
/** Bangla month in Bangla digit */
|
|
62
|
+
/** Bangla month in Bangla digit */
|
|
63
|
+
bn: BanglaMonth;
|
|
64
|
+
/** Bangla month in Latin digit */
|
|
62
65
|
en: NumberRange<1, 12>;
|
|
63
66
|
}>;
|
|
64
67
|
/** Bangla day of the month */
|
|
65
68
|
readonly date: Readonly<{
|
|
66
|
-
/** Bangla day of the month in Bangla digit */
|
|
69
|
+
/** Bangla day of the month in Bangla digit */
|
|
70
|
+
bn: BanglaDate;
|
|
71
|
+
/** Bangla day of the month in Latin digit */
|
|
67
72
|
en: NumberRange<1, 31>;
|
|
68
73
|
}>;
|
|
69
74
|
/** Gregorian equivalent of the current bangla date */
|
|
70
75
|
readonly gregorian: Readonly<{
|
|
71
|
-
/** Gregorian year in Latin digit */
|
|
72
|
-
|
|
76
|
+
/** Gregorian year in Latin digit */
|
|
77
|
+
year: number;
|
|
78
|
+
/** Gregorian month in Latin digit (`1-12`) */
|
|
79
|
+
month: NumberRange<1, 12>;
|
|
80
|
+
/** Gregorian day of the month in Latin digit (`1-31`) */
|
|
73
81
|
date: NumberRange<1, 31>;
|
|
74
82
|
}>;
|
|
75
83
|
/** Gets the day of the week (0-6, where 0 is Sunday (রবিবার)). */
|
package/dist/index.d.mts
CHANGED
|
@@ -14,9 +14,8 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import { a as Enumerate, s as NumberRange } from "./
|
|
18
|
-
import {
|
|
19
|
-
|
|
17
|
+
import { a as Enumerate, s as NumberRange } from "./index-RyvzOKVa-BA85h5wj.mjs";
|
|
18
|
+
import { a as $BnEn, c as BanglaDate, d as BanglaMonth, f as BanglaMonthName, g as BnCalendarVariant, h as BnCalendarConfig, l as BanglaDateFormat, m as BanglaYear, p as BanglaSeasonName, u as BanglaDayName } from "./types-HdT16D_P.mjs";
|
|
20
19
|
//#region src/BanglaCalendar.d.ts
|
|
21
20
|
/**
|
|
22
21
|
* @class Represents a date in the Bangla calendar system with support for different variants.
|
|
@@ -53,23 +52,32 @@ declare class BanglaCalendar {
|
|
|
53
52
|
readonly variant: BnCalendarVariant;
|
|
54
53
|
/** Bangla year */
|
|
55
54
|
readonly year: Readonly<{
|
|
56
|
-
/** Bangla year in Bangla digit */
|
|
55
|
+
/** Bangla year in Bangla digit */
|
|
56
|
+
bn: BanglaYear;
|
|
57
|
+
/** Bangla year in Latin digit */
|
|
57
58
|
en: number;
|
|
58
59
|
}>;
|
|
59
60
|
/** Bangla month */
|
|
60
61
|
readonly month: Readonly<{
|
|
61
|
-
/** Bangla month in Bangla digit */
|
|
62
|
+
/** Bangla month in Bangla digit */
|
|
63
|
+
bn: BanglaMonth;
|
|
64
|
+
/** Bangla month in Latin digit */
|
|
62
65
|
en: NumberRange<1, 12>;
|
|
63
66
|
}>;
|
|
64
67
|
/** Bangla day of the month */
|
|
65
68
|
readonly date: Readonly<{
|
|
66
|
-
/** Bangla day of the month in Bangla digit */
|
|
69
|
+
/** Bangla day of the month in Bangla digit */
|
|
70
|
+
bn: BanglaDate;
|
|
71
|
+
/** Bangla day of the month in Latin digit */
|
|
67
72
|
en: NumberRange<1, 31>;
|
|
68
73
|
}>;
|
|
69
74
|
/** Gregorian equivalent of the current bangla date */
|
|
70
75
|
readonly gregorian: Readonly<{
|
|
71
|
-
/** Gregorian year in Latin digit */
|
|
72
|
-
|
|
76
|
+
/** Gregorian year in Latin digit */
|
|
77
|
+
year: number;
|
|
78
|
+
/** Gregorian month in Latin digit (`1-12`) */
|
|
79
|
+
month: NumberRange<1, 12>;
|
|
80
|
+
/** Gregorian day of the month in Latin digit (`1-31`) */
|
|
73
81
|
date: NumberRange<1, 31>;
|
|
74
82
|
}>;
|
|
75
83
|
/** Gets the day of the week (0-6, where 0 is Sunday (রবিবার)). */
|
package/dist/index.mjs
CHANGED
|
@@ -14,9 +14,9 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import { a as
|
|
17
|
+
import { a as normalizeNumber, c as isNumber, i as isObjectWithKeys, n as digitToBangla, o as isInteger, r as isDateString, s as isNonEmptyString, t as banglaToDigit } from "./dist-C5OaVGq-.mjs";
|
|
18
18
|
|
|
19
|
-
//#region node_modules/.pnpm/toolbox-x@
|
|
19
|
+
//#region node_modules/.pnpm/toolbox-x@2.6.16/node_modules/toolbox-x/dist/guards-CV5StNcy.mjs
|
|
20
20
|
/**
|
|
21
21
|
* * Checks if the year is a leap year.
|
|
22
22
|
*
|
|
@@ -278,7 +278,7 @@ const SORTED_TIME_FORMATS = /* @__PURE__ */ Object.freeze([
|
|
|
278
278
|
|
|
279
279
|
//#endregion
|
|
280
280
|
//#region src/helpers.ts
|
|
281
|
-
/** Core formatting logic shared by `
|
|
281
|
+
/** Core formatting logic shared by `BanglaCalendar` and possible future implementation */
|
|
282
282
|
function _formatDateCore(format, dateComponents) {
|
|
283
283
|
const tokenRegex = new RegExp(`^(${SORTED_TIME_FORMATS.join("|")})`);
|
|
284
284
|
let result = "";
|
|
@@ -416,7 +416,7 @@ var BanglaCalendar = class BanglaCalendar {
|
|
|
416
416
|
constructor(dateBnYrOrCfg, bnMonthOrCfg, bnDateOrCfg, config) {
|
|
417
417
|
this.variant = this.#processVariants(dateBnYrOrCfg, bnMonthOrCfg, bnDateOrCfg, config);
|
|
418
418
|
let date = dateBnYrOrCfg instanceof Date ? dateBnYrOrCfg : new Date(isDateString(dateBnYrOrCfg) && !BanglaCalendar.isBanglaDateString(dateBnYrOrCfg) ? dateBnYrOrCfg : isNumber(dateBnYrOrCfg) && !BanglaCalendar.isBanglaYearEn(dateBnYrOrCfg) ? dateBnYrOrCfg : Date.now());
|
|
419
|
-
if (isNaN(date.getTime())) date = /* @__PURE__ */ new Date();
|
|
419
|
+
if (Number.isNaN(date.getTime())) date = /* @__PURE__ */ new Date();
|
|
420
420
|
const { year, month, monthDate } = this.#processDate(date);
|
|
421
421
|
let bnYear = BanglaCalendar.isBanglaYear(dateBnYrOrCfg) ? banglaToDigit(dateBnYrOrCfg) : isNumber(dateBnYrOrCfg) && BanglaCalendar.isBanglaYearEn(dateBnYrOrCfg) ? dateBnYrOrCfg : year;
|
|
422
422
|
let bnMonth = BanglaCalendar.isBanglaMonth(bnMonthOrCfg) ? banglaToDigit(bnMonthOrCfg) : BanglaCalendar.isBanglaMonthEn(bnMonthOrCfg) ? bnMonthOrCfg : month;
|
|
@@ -938,7 +938,7 @@ var BanglaCalendar = class BanglaCalendar {
|
|
|
938
938
|
DD: _padShunno(date.bn),
|
|
939
939
|
Do: date.bn,
|
|
940
940
|
S: seasonName,
|
|
941
|
-
SS: seasonName
|
|
941
|
+
SS: `${seasonName}কাল`
|
|
942
942
|
};
|
|
943
943
|
return _formatDateCore(format || "ddd, DD mmmm (SS), YYYY বঙ্গাব্দ", dateComponents);
|
|
944
944
|
}
|
|
@@ -974,7 +974,8 @@ var BanglaCalendar = class BanglaCalendar {
|
|
|
974
974
|
#getClampedBnCal(tyBn, tmBn, cdBn, variant) {
|
|
975
975
|
const { gregYear } = this.#processGregYear(tyBn, tmBn);
|
|
976
976
|
const { bnMonthTable } = this.#getBnMonthTableLeap(gregYear, tyBn);
|
|
977
|
-
|
|
977
|
+
const tdBn = Math.min(cdBn, bnMonthTable[tmBn - 1]);
|
|
978
|
+
return new BanglaCalendar(tyBn, tmBn, tdBn, { variant });
|
|
978
979
|
}
|
|
979
980
|
/** Process variant from the config */
|
|
980
981
|
#processVariants(v1, v2, v3, v4) {
|