@bbn/bbn 2.0.95 → 2.0.97
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/dist/bbn.js +1 -1
- package/dist/bbn.js.map +1 -1
- package/dist/dt/index.d.ts +8 -0
- package/dist/dt/index.js +8 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -3
- package/package.json +1 -1
- package/dist/date.d.ts +0 -127
- package/dist/date.js +0 -1506
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import bbnDtDate from './classes/date.js';
|
|
2
|
+
import bbnDtDateTime from './classes/dateTime.js';
|
|
3
|
+
import bbnDtTime from './classes/time.js';
|
|
4
|
+
import bbnDtYearMonth from './classes/yearMonth.js';
|
|
5
|
+
import bbnDtMonthDay from './classes/monthDay.js';
|
|
6
|
+
import bbnDtZoned from './classes/zoned.js';
|
|
7
|
+
import bbnDtDuration from './classes/duration.js';
|
|
8
|
+
export { bbnDtDate, bbnDtDateTime, bbnDtTime, bbnDtYearMonth, bbnDtMonthDay, bbnDtZoned, bbnDtDuration };
|
package/dist/dt/index.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import bbnDtDate from './classes/date.js';
|
|
2
|
+
import bbnDtDateTime from './classes/dateTime.js';
|
|
3
|
+
import bbnDtTime from './classes/time.js';
|
|
4
|
+
import bbnDtYearMonth from './classes/yearMonth.js';
|
|
5
|
+
import bbnDtMonthDay from './classes/monthDay.js';
|
|
6
|
+
import bbnDtZoned from './classes/zoned.js';
|
|
7
|
+
import bbnDtDuration from './classes/duration.js';
|
|
8
|
+
export { bbnDtDate, bbnDtDateTime, bbnDtTime, bbnDtYearMonth, bbnDtMonthDay, bbnDtZoned, bbnDtDuration };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { Temporal } from 'temporal-polyfill';
|
|
2
|
+
import { bbnDtDate, bbnDtDateTime, bbnDtTime, bbnDtYearMonth, bbnDtMonthDay, bbnDtZoned, bbnDtDuration } from './dt/index.js';
|
|
2
3
|
declare const bbn: Bbn;
|
|
3
|
-
export { bbn as default, bbn, Temporal };
|
|
4
|
+
export { bbn as default, bbn, Temporal, bbnDtDate, bbnDtDateTime, bbnDtTime, bbnDtYearMonth, bbnDtMonthDay, bbnDtZoned, bbnDtDuration };
|
package/dist/index.js
CHANGED
|
@@ -7,8 +7,8 @@ import env from './env.js';
|
|
|
7
7
|
import com from './com.js';
|
|
8
8
|
import db from './db.js';
|
|
9
9
|
import fn from './fn.js';
|
|
10
|
-
import date from './date.js';
|
|
11
10
|
import dt from './dt.js';
|
|
11
|
+
import { bbnDtDate, bbnDtDateTime, bbnDtTime, bbnDtYearMonth, bbnDtMonthDay, bbnDtZoned, bbnDtDuration } from './dt/index.js';
|
|
12
12
|
const bbn = {
|
|
13
13
|
version: "1.0.1",
|
|
14
14
|
opt: {
|
|
@@ -19,7 +19,6 @@ const bbn = {
|
|
|
19
19
|
$,
|
|
20
20
|
lng,
|
|
21
21
|
var: vars,
|
|
22
|
-
date,
|
|
23
22
|
dt,
|
|
24
23
|
com,
|
|
25
24
|
env,
|
|
@@ -100,4 +99,4 @@ if ('undefined' !== typeof window) {
|
|
|
100
99
|
window.Temporal = Temporal;
|
|
101
100
|
}
|
|
102
101
|
}
|
|
103
|
-
export { bbn as default, bbn, Temporal };
|
|
102
|
+
export { bbn as default, bbn, Temporal, bbnDtDate, bbnDtDateTime, bbnDtTime, bbnDtYearMonth, bbnDtMonthDay, bbnDtZoned, bbnDtDuration };
|
package/package.json
CHANGED
package/dist/date.d.ts
DELETED
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
declare class bbnDateTool {
|
|
2
|
-
#private;
|
|
3
|
-
/**
|
|
4
|
-
* Parses a date string strictly according to a format.
|
|
5
|
-
*
|
|
6
|
-
* Supported tokens:
|
|
7
|
-
* Years: YYYY, YY, Y
|
|
8
|
-
* Months: MMMM, MMM, MM, M, m
|
|
9
|
-
* Days: DD, D, d
|
|
10
|
-
* Weekday: dddd, ddd, EE (validation only)
|
|
11
|
-
* Hours: HH, H, h
|
|
12
|
-
* Minutes: II, I, i
|
|
13
|
-
* Seconds: SS, S, s
|
|
14
|
-
* Milli: ms
|
|
15
|
-
* Weeks: WWWW, WWW, WW, W (parsed but not used to build the Date)
|
|
16
|
-
*
|
|
17
|
-
* @throws Error if parsing fails or the date is invalid.
|
|
18
|
-
*/
|
|
19
|
-
static parse(input: string, format: string, locale?: {
|
|
20
|
-
monthsLong?: string[];
|
|
21
|
-
monthsShort?: string[];
|
|
22
|
-
weekdaysLong?: string[];
|
|
23
|
-
weekdaysShort?: string[];
|
|
24
|
-
}): Date;
|
|
25
|
-
/**
|
|
26
|
-
* Compare 2 dates with a given precision.
|
|
27
|
-
* @returns -1 if this < other, 0 if equal, 1 if this > other
|
|
28
|
-
*/
|
|
29
|
-
static compare(date1: any, date2: any, unit?: string): -1 | 0 | 1;
|
|
30
|
-
constructor(value: any, inputFormat?: null | String);
|
|
31
|
-
parse(input: string, format: string): bbnDateTool;
|
|
32
|
-
matchFormat(value: any, format: string): boolean;
|
|
33
|
-
toString(): string;
|
|
34
|
-
year(v?: any): number | bbnDateTool;
|
|
35
|
-
month(v?: any): number | bbnDateTool;
|
|
36
|
-
day(v?: any): number | bbnDateTool;
|
|
37
|
-
hour(v?: any): number | bbnDateTool;
|
|
38
|
-
minute(v?: any): number | bbnDateTool;
|
|
39
|
-
second(v?: any): number | bbnDateTool;
|
|
40
|
-
weekday(v?: any, past?: boolean): number | bbnDateTool;
|
|
41
|
-
/**
|
|
42
|
-
* Returns the ISO-8601 week number of this date.
|
|
43
|
-
* Week starts on Monday, and week 1 is the week with Jan 4.
|
|
44
|
-
*
|
|
45
|
-
* @returns {number} ISO week number (1–53)
|
|
46
|
-
*/
|
|
47
|
-
week(): number;
|
|
48
|
-
get tst(): number;
|
|
49
|
-
get mtst(): number;
|
|
50
|
-
get YYYY(): string;
|
|
51
|
-
get YY(): string;
|
|
52
|
-
get MMMM(): string;
|
|
53
|
-
get MMM(): string;
|
|
54
|
-
get MM(): string;
|
|
55
|
-
get M(): string;
|
|
56
|
-
get EE(): string;
|
|
57
|
-
get DD(): string;
|
|
58
|
-
get d(): string;
|
|
59
|
-
get dddd(): string;
|
|
60
|
-
get ddd(): string;
|
|
61
|
-
get D(): string;
|
|
62
|
-
get HH(): string;
|
|
63
|
-
get H(): string;
|
|
64
|
-
get II(): string;
|
|
65
|
-
get mm(): string;
|
|
66
|
-
get I(): string;
|
|
67
|
-
get SS(): string;
|
|
68
|
-
get S(): string;
|
|
69
|
-
get WW(): string;
|
|
70
|
-
get isValid(): boolean;
|
|
71
|
-
dateFromFormat(value: string, unit: string | null): Date;
|
|
72
|
-
date(v?: any): string | bbnDateTool;
|
|
73
|
-
datetime(v?: any): string | bbnDateTool;
|
|
74
|
-
time(v?: any): string | bbnDateTool;
|
|
75
|
-
fdate(long?: boolean, withTime?: boolean, weekday?: boolean): string;
|
|
76
|
-
ftime(withSeconds?: boolean): string;
|
|
77
|
-
format(format?: string): string;
|
|
78
|
-
unix(ms?: boolean | number): number | bbnDateTool;
|
|
79
|
-
sql(noTime?: boolean): string;
|
|
80
|
-
inLeapYear(): boolean;
|
|
81
|
-
daysInMonth(): number;
|
|
82
|
-
valueOf(): number;
|
|
83
|
-
/**
|
|
84
|
-
* Compare this date to another date with a given precision.
|
|
85
|
-
* @returns -1 if this < other, 0 if equal, 1 if this > other
|
|
86
|
-
*/
|
|
87
|
-
compare(date: any, unit?: string): -1 | 0 | 1;
|
|
88
|
-
add(value: number, unit?: string): bbnDateTool | null;
|
|
89
|
-
subtract(value: number, unit?: string): bbnDateTool;
|
|
90
|
-
isBefore(date: any, unit?: string): Boolean;
|
|
91
|
-
isAfter(date: any, unit?: string): Boolean;
|
|
92
|
-
isSame(date: any, unit?: string): Boolean;
|
|
93
|
-
isAfterOrSame(date: any, unit?: string): Boolean;
|
|
94
|
-
isBeforeOrSame(date: any, unit?: string): Boolean;
|
|
95
|
-
fromNow(unit?: string): string;
|
|
96
|
-
fromDate(date: any, unit?: string): string;
|
|
97
|
-
guessUnit(valueInMs: number): string | null;
|
|
98
|
-
diff(date: any, unit?: string, abs?: boolean): number;
|
|
99
|
-
calendar(format: string): string;
|
|
100
|
-
getWeekday(n: 0 | 1 | 2 | 3 | 4 | 5 | 6, mode?: string, locale?: string): any;
|
|
101
|
-
getWeekdayIndex(name: string, locale?: string): number;
|
|
102
|
-
/**
|
|
103
|
-
* Returns a NEW date that is the next (or previous if past=true)
|
|
104
|
-
* occurrence of the given weekday, starting from this.#value.
|
|
105
|
-
*
|
|
106
|
-
* @param {number|string} weekday - Weekday index (0=Sunday…6=Saturday)
|
|
107
|
-
* or a localized weekday name.
|
|
108
|
-
* @param {boolean} past - If true → return previous occurrence instead of next.
|
|
109
|
-
* @param {string} [locale] - Optional locale for weekday names.
|
|
110
|
-
*/
|
|
111
|
-
setWeekday(weekday: number | string, past?: boolean, locale?: string): bbnDateTool;
|
|
112
|
-
copy(): Date;
|
|
113
|
-
clone(): bbnDateTool;
|
|
114
|
-
/**
|
|
115
|
-
* Returns a NEW bbnDateTool at the start of the given unit.
|
|
116
|
-
* Units: year, month, week, day, hour, minute, second
|
|
117
|
-
*/
|
|
118
|
-
startOf(unit?: string): bbnDateTool;
|
|
119
|
-
/**
|
|
120
|
-
* Returns a NEW bbnDateTool at the end of the given unit.
|
|
121
|
-
* Units: year, month, week, day, hour, minute, second
|
|
122
|
-
*/
|
|
123
|
-
endOf(unit?: string): bbnDateTool;
|
|
124
|
-
duration(num: number, unit?: string): any;
|
|
125
|
-
}
|
|
126
|
-
declare function generatorFunction(value: any, inputFormat?: null | String): bbnDateTool;
|
|
127
|
-
export default generatorFunction;
|