utilsfordate 1.0.1 → 2.0.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 +150 -0
- package/dist/index.d.ts +187 -4
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +680 -13
- package/dist/index.js.map +1 -0
- package/package.json +20 -9
- package/test/test.js +0 -8
- package/tsconfig.json +0 -60
package/README.md
ADDED
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
# utilsfordate
|
|
2
|
+
|
|
3
|
+
A comprehensive, zero-dependency TypeScript date utility library.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install utilsfordate
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
import { format, toISODate, addDays, fromNow, isToday } from 'utilsfordate';
|
|
15
|
+
|
|
16
|
+
format(new Date(), 'DDDD, MMMM Do YYYY'); // "Saturday, February 28th 2026"
|
|
17
|
+
toISODate(new Date()); // "2026-02-28"
|
|
18
|
+
addDays(new Date(), 7); // Date 7 days from now
|
|
19
|
+
fromNow('2026-01-01'); // "2 months ago"
|
|
20
|
+
isToday(new Date()); // true
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## API
|
|
24
|
+
|
|
25
|
+
### Formatting
|
|
26
|
+
|
|
27
|
+
| Function | Example Output |
|
|
28
|
+
|---|---|
|
|
29
|
+
| `format(date, pattern)` | Custom token-based format |
|
|
30
|
+
| `toISODate(date)` | `2026-02-28` |
|
|
31
|
+
| `toISODateTime(date)` | `2026-02-28T14:30:00` |
|
|
32
|
+
| `toISOFull(date)` | `2026-02-28T14:30:00+05:30` |
|
|
33
|
+
| `toUSShort(date)` | `02/28/2026` |
|
|
34
|
+
| `toEUShort(date)` | `28/02/2026` |
|
|
35
|
+
| `toUSLong(date)` | `February 28, 2026` |
|
|
36
|
+
| `toEULong(date)` | `28 February 2026` |
|
|
37
|
+
| `toShortMonth(date)` | `Feb 28, 2026` |
|
|
38
|
+
| `toFullWithWeekday(date)` | `Saturday, February 28, 2026` |
|
|
39
|
+
| `toRFC2822(date)` | `Sat, 28 Feb 2026 14:30:00 +0000` |
|
|
40
|
+
| `toTime12h(date)` | `2:30 PM` |
|
|
41
|
+
| `toTimeLong(date)` | `14:30:00` |
|
|
42
|
+
| `toTimeWithMs(date)` | `14:30:00.123` |
|
|
43
|
+
| `toUnixTimestamp(date)` | `1740744600` |
|
|
44
|
+
| `toQuarter(date)` | `Q1 2026` |
|
|
45
|
+
| `toISOWeek(date)` | `2026-W09` |
|
|
46
|
+
| `toLocaleString(date, locale)` | Intl-based locale format |
|
|
47
|
+
|
|
48
|
+
### Format Tokens
|
|
49
|
+
|
|
50
|
+
| Token | Output |
|
|
51
|
+
|---|---|
|
|
52
|
+
| `YYYY` / `YY` | `2026` / `26` |
|
|
53
|
+
| `MMMM` / `MMM` / `MM` / `M` | `February` / `Feb` / `02` / `2` |
|
|
54
|
+
| `DDDD` / `DDD` | `Saturday` / `Sat` |
|
|
55
|
+
| `DD` / `D` / `Do` | `28` / `28` / `28th` |
|
|
56
|
+
| `HH` / `H` / `hh` / `h` | 24h / 12h variants |
|
|
57
|
+
| `mm` / `ss` / `SSS` | Minutes / Seconds / Milliseconds |
|
|
58
|
+
| `A` / `a` | `AM` / `am` |
|
|
59
|
+
| `Z` / `ZZ` | `+05:30` / `+0530` |
|
|
60
|
+
| `X` / `x` | Unix seconds / ms |
|
|
61
|
+
| `Q` / `W` | Quarter / ISO Week |
|
|
62
|
+
| `[text]` | Literal escape |
|
|
63
|
+
|
|
64
|
+
### Manipulation
|
|
65
|
+
|
|
66
|
+
```typescript
|
|
67
|
+
addDays(date, 5) subtractDays(date, 5)
|
|
68
|
+
addMonths(date, 2) subtractMonths(date, 2)
|
|
69
|
+
addYears(date, 1) subtractYears(date, 1)
|
|
70
|
+
addHours(date, 3) addMinutes(date, 30)
|
|
71
|
+
addWeeks(date, 2) addSeconds(date, 60)
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### Start / End of Period
|
|
75
|
+
|
|
76
|
+
```typescript
|
|
77
|
+
startOfDay(date) endOfDay(date)
|
|
78
|
+
startOfWeek(date) endOfWeek(date)
|
|
79
|
+
startOfMonth(date) endOfMonth(date)
|
|
80
|
+
startOfQuarter(date) endOfQuarter(date)
|
|
81
|
+
startOfYear(date) endOfYear(date)
|
|
82
|
+
startOfHour(date) endOfHour(date)
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### Predicates
|
|
86
|
+
|
|
87
|
+
```typescript
|
|
88
|
+
isToday(date) isYesterday(date) isTomorrow(date)
|
|
89
|
+
isPast(date) isFuture(date)
|
|
90
|
+
isWeekend(date) isWeekday(date)
|
|
91
|
+
isLeapYear(date) isValidDate(date)
|
|
92
|
+
isBefore(a, b) isAfter(a, b)
|
|
93
|
+
isSameDay(a, b) isSameMonth(a, b) isSameYear(a, b)
|
|
94
|
+
isBetween(date, start, end)
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### Diff
|
|
98
|
+
|
|
99
|
+
```typescript
|
|
100
|
+
diff(a, b) // => { years, months, weeks, days, hours, minutes, seconds, ms }
|
|
101
|
+
diffInDays(a, b)
|
|
102
|
+
diffInMonths(a, b)
|
|
103
|
+
diffInYears(a, b)
|
|
104
|
+
durationBetween(a, b) // => "3 days, 2 hours"
|
|
105
|
+
fromNow(date) // => "2 months ago" / "in 3 days"
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
### Parsing
|
|
109
|
+
|
|
110
|
+
```typescript
|
|
111
|
+
parseDDMMYYYY('28/02/2026')
|
|
112
|
+
parseMMDDYYYY('02/28/2026')
|
|
113
|
+
parseYYYYMMDD('2026-02-28')
|
|
114
|
+
parseAny('Feb 28 2026')
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
### Getters
|
|
118
|
+
|
|
119
|
+
```typescript
|
|
120
|
+
getAge(date)
|
|
121
|
+
getQuarter(date)
|
|
122
|
+
getWeekNumber(date)
|
|
123
|
+
getDayOfYear(date)
|
|
124
|
+
getDaysInMonth(date)
|
|
125
|
+
getDaysInYear(date)
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
### Timezone
|
|
129
|
+
|
|
130
|
+
```typescript
|
|
131
|
+
toTimezone(date, 'Asia/Kolkata')
|
|
132
|
+
getTimezoneOffset('America/New_York')
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
### Convenience
|
|
136
|
+
|
|
137
|
+
```typescript
|
|
138
|
+
now() // current Date
|
|
139
|
+
today() // start of today
|
|
140
|
+
tomorrow() // start of tomorrow
|
|
141
|
+
yesterday() // start of yesterday
|
|
142
|
+
min(d1, d2, d3)
|
|
143
|
+
max(d1, d2, d3)
|
|
144
|
+
clamp(date, min, max)
|
|
145
|
+
roundToNearestMinutes(date, 15)
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
## License
|
|
149
|
+
|
|
150
|
+
ISC
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,187 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
/**
|
|
2
|
+
* utilsfordate - Comprehensive Date Utility Library
|
|
3
|
+
* Supports all major date formats, parsing, formatting, manipulation, and validation.
|
|
4
|
+
*/
|
|
5
|
+
export type DateInput = Date | string | number;
|
|
6
|
+
export interface DateDiff {
|
|
7
|
+
years: number;
|
|
8
|
+
months: number;
|
|
9
|
+
weeks: number;
|
|
10
|
+
days: number;
|
|
11
|
+
hours: number;
|
|
12
|
+
minutes: number;
|
|
13
|
+
seconds: number;
|
|
14
|
+
milliseconds: number;
|
|
15
|
+
}
|
|
16
|
+
export type Locale = string;
|
|
17
|
+
export type DayOfWeek = 'Sunday' | 'Monday' | 'Tuesday' | 'Wednesday' | 'Thursday' | 'Friday' | 'Saturday';
|
|
18
|
+
/**
|
|
19
|
+
* Normalise any DateInput to a native Date object.
|
|
20
|
+
*/
|
|
21
|
+
export declare function toDate(input: DateInput): Date;
|
|
22
|
+
/** Returns true if the input represents a valid date. */
|
|
23
|
+
export declare function isValidDate(input: DateInput): boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Low-level token-based formatter.
|
|
26
|
+
*
|
|
27
|
+
* Supported tokens:
|
|
28
|
+
*
|
|
29
|
+
* | Token | Output example | Description |
|
|
30
|
+
* |--------|-----------------------|-------------------------------------|
|
|
31
|
+
* | YYYY | 2024 | 4-digit year |
|
|
32
|
+
* | YY | 24 | 2-digit year |
|
|
33
|
+
* | MMMM | January | Full month name |
|
|
34
|
+
* | MMM | Jan | Short month name |
|
|
35
|
+
* | MM | 01–12 | Zero-padded month |
|
|
36
|
+
* | M | 1–12 | Month (no pad) |
|
|
37
|
+
* | DDDD | Monday | Full weekday name |
|
|
38
|
+
* | DDD | Mon | Short weekday name |
|
|
39
|
+
* | DD | 01–31 | Zero-padded day |
|
|
40
|
+
* | D | 1–31 | Day (no pad) |
|
|
41
|
+
* | Do | 1st, 2nd … | Ordinal day |
|
|
42
|
+
* | HH | 00–23 | Zero-padded 24-hour |
|
|
43
|
+
* | H | 0–23 | 24-hour (no pad) |
|
|
44
|
+
* | hh | 01–12 | Zero-padded 12-hour |
|
|
45
|
+
* | h | 1–12 | 12-hour (no pad) |
|
|
46
|
+
* | mm | 00–59 | Zero-padded minutes |
|
|
47
|
+
* | m | 0–59 | Minutes (no pad) |
|
|
48
|
+
* | ss | 00–59 | Zero-padded seconds |
|
|
49
|
+
* | s | 0–59 | Seconds (no pad) |
|
|
50
|
+
* | SSS | 000–999 | Milliseconds |
|
|
51
|
+
* | A | AM / PM | Upper-case meridiem |
|
|
52
|
+
* | a | am / pm | Lower-case meridiem |
|
|
53
|
+
* | Z | +05:30 | UTC offset ±HH:MM |
|
|
54
|
+
* | ZZ | +0530 | UTC offset ±HHMM |
|
|
55
|
+
* | X | 1714000000 | Unix timestamp (seconds) |
|
|
56
|
+
* | x | 1714000000000 | Unix timestamp (ms) |
|
|
57
|
+
* | Q | 1–4 | Quarter |
|
|
58
|
+
* | W | 1–53 | ISO week number |
|
|
59
|
+
* | [text] | text | Literal escape |
|
|
60
|
+
*/
|
|
61
|
+
export declare function format(input: DateInput, pattern: string): string;
|
|
62
|
+
/** 2024-01-15 (ISO 8601 date) */
|
|
63
|
+
export declare function toISODate(input: DateInput): string;
|
|
64
|
+
/** 2024-01-15T14:30:00 (ISO 8601 datetime, local) */
|
|
65
|
+
export declare function toISODateTime(input: DateInput): string;
|
|
66
|
+
/** Full ISO 8601 with offset: 2024-01-15T14:30:00+05:30 */
|
|
67
|
+
export declare function toISOFull(input: DateInput): string;
|
|
68
|
+
/** 01/15/2024 (US short) */
|
|
69
|
+
export declare function toUSShort(input: DateInput): string;
|
|
70
|
+
/** 15/01/2024 (EU short) */
|
|
71
|
+
export declare function toEUShort(input: DateInput): string;
|
|
72
|
+
/** January 15, 2024 (US long) */
|
|
73
|
+
export declare function toUSLong(input: DateInput): string;
|
|
74
|
+
/** 15 January 2024 (EU long) */
|
|
75
|
+
export declare function toEULong(input: DateInput): string;
|
|
76
|
+
/** Jan 15, 2024 */
|
|
77
|
+
export declare function toShortMonth(input: DateInput): string;
|
|
78
|
+
/** Monday, January 15, 2024 */
|
|
79
|
+
export declare function toFullWithWeekday(input: DateInput): string;
|
|
80
|
+
/** Mon, 15 Jan 2024 */
|
|
81
|
+
export declare function toRFC1123Date(input: DateInput): string;
|
|
82
|
+
/** Mon, 15 Jan 2024 14:30:00 +0000 (RFC 2822 / email) */
|
|
83
|
+
export declare function toRFC2822(input: DateInput): string;
|
|
84
|
+
/** 14:30 (HH:mm) */
|
|
85
|
+
export declare function toTimeShort(input: DateInput): string;
|
|
86
|
+
/** 14:30:00 (HH:mm:ss) */
|
|
87
|
+
export declare function toTimeLong(input: DateInput): string;
|
|
88
|
+
/** 2:30 PM (12-hour) */
|
|
89
|
+
export declare function toTime12h(input: DateInput): string;
|
|
90
|
+
/** 14:30:00.123 (with ms) */
|
|
91
|
+
export declare function toTimeWithMs(input: DateInput): string;
|
|
92
|
+
/** Unix timestamp in seconds */
|
|
93
|
+
export declare function toUnixTimestamp(input: DateInput): number;
|
|
94
|
+
/** Unix timestamp in milliseconds */
|
|
95
|
+
export declare function toUnixMs(input: DateInput): number;
|
|
96
|
+
/** Q1 2024 */
|
|
97
|
+
export declare function toQuarter(input: DateInput): string;
|
|
98
|
+
/** 2024-W03 (ISO week) */
|
|
99
|
+
export declare function toISOWeek(input: DateInput): string;
|
|
100
|
+
/** Locale-aware formatting using Intl.DateTimeFormat */
|
|
101
|
+
export declare function toLocaleString(input: DateInput, locale?: Locale, options?: Intl.DateTimeFormatOptions): string;
|
|
102
|
+
/** Locale date only */
|
|
103
|
+
export declare function toLocaleDate(input: DateInput, locale?: Locale): string;
|
|
104
|
+
/** Locale time only */
|
|
105
|
+
export declare function toLocaleTime(input: DateInput, locale?: Locale): string;
|
|
106
|
+
/**
|
|
107
|
+
* Returns a human-readable relative string, e.g. "3 days ago", "in 2 hours".
|
|
108
|
+
*/
|
|
109
|
+
export declare function fromNow(input: DateInput, locale?: Locale): string;
|
|
110
|
+
/** Duration between two dates as a readable string, e.g. "3 days, 2 hours". */
|
|
111
|
+
export declare function durationBetween(a: DateInput, b: DateInput): string;
|
|
112
|
+
/** Returns the full structured difference between two dates. */
|
|
113
|
+
export declare function diff(a: DateInput, b: DateInput): DateDiff;
|
|
114
|
+
/** Difference in whole days (negative if a > b). */
|
|
115
|
+
export declare function diffInDays(a: DateInput, b: DateInput): number;
|
|
116
|
+
/** Difference in whole months. */
|
|
117
|
+
export declare function diffInMonths(a: DateInput, b: DateInput): number;
|
|
118
|
+
/** Difference in whole years. */
|
|
119
|
+
export declare function diffInYears(a: DateInput, b: DateInput): number;
|
|
120
|
+
export declare function addMilliseconds(input: DateInput, amount: number): Date;
|
|
121
|
+
export declare function addSeconds(input: DateInput, amount: number): Date;
|
|
122
|
+
export declare function addMinutes(input: DateInput, amount: number): Date;
|
|
123
|
+
export declare function addHours(input: DateInput, amount: number): Date;
|
|
124
|
+
export declare function addDays(input: DateInput, amount: number): Date;
|
|
125
|
+
export declare function addWeeks(input: DateInput, amount: number): Date;
|
|
126
|
+
export declare function addMonths(input: DateInput, amount: number): Date;
|
|
127
|
+
export declare function addYears(input: DateInput, amount: number): Date;
|
|
128
|
+
export declare function subtractDays(input: DateInput, amount: number): Date;
|
|
129
|
+
export declare function subtractMonths(input: DateInput, amount: number): Date;
|
|
130
|
+
export declare function subtractYears(input: DateInput, amount: number): Date;
|
|
131
|
+
export declare function startOfDay(input: DateInput): Date;
|
|
132
|
+
export declare function endOfDay(input: DateInput): Date;
|
|
133
|
+
export declare function startOfMonth(input: DateInput): Date;
|
|
134
|
+
export declare function endOfMonth(input: DateInput): Date;
|
|
135
|
+
export declare function startOfYear(input: DateInput): Date;
|
|
136
|
+
export declare function endOfYear(input: DateInput): Date;
|
|
137
|
+
export declare function startOfWeek(input: DateInput, weekStartsOn?: 0 | 1): Date;
|
|
138
|
+
export declare function endOfWeek(input: DateInput, weekStartsOn?: 0 | 1): Date;
|
|
139
|
+
export declare function startOfHour(input: DateInput): Date;
|
|
140
|
+
export declare function endOfHour(input: DateInput): Date;
|
|
141
|
+
export declare function startOfMinute(input: DateInput): Date;
|
|
142
|
+
export declare function endOfMinute(input: DateInput): Date;
|
|
143
|
+
export declare function startOfQuarter(input: DateInput): Date;
|
|
144
|
+
export declare function endOfQuarter(input: DateInput): Date;
|
|
145
|
+
export declare function isBefore(a: DateInput, b: DateInput): boolean;
|
|
146
|
+
export declare function isAfter(a: DateInput, b: DateInput): boolean;
|
|
147
|
+
export declare function isSameDay(a: DateInput, b: DateInput): boolean;
|
|
148
|
+
export declare function isSameMonth(a: DateInput, b: DateInput): boolean;
|
|
149
|
+
export declare function isSameYear(a: DateInput, b: DateInput): boolean;
|
|
150
|
+
export declare function isToday(input: DateInput): boolean;
|
|
151
|
+
export declare function isYesterday(input: DateInput): boolean;
|
|
152
|
+
export declare function isTomorrow(input: DateInput): boolean;
|
|
153
|
+
export declare function isPast(input: DateInput): boolean;
|
|
154
|
+
export declare function isFuture(input: DateInput): boolean;
|
|
155
|
+
export declare function isWeekend(input: DateInput): boolean;
|
|
156
|
+
export declare function isWeekday(input: DateInput): boolean;
|
|
157
|
+
export declare function isLeapYear(input: DateInput): boolean;
|
|
158
|
+
export declare function isBetween(input: DateInput, start: DateInput, end: DateInput, inclusive?: boolean): boolean;
|
|
159
|
+
export declare function getDayOfYear(input: DateInput): number;
|
|
160
|
+
export declare function getDaysInMonth(input: DateInput): number;
|
|
161
|
+
export declare function getDaysInYear(input: DateInput): number;
|
|
162
|
+
export declare function getWeekNumber(input: DateInput): number;
|
|
163
|
+
export declare function getQuarter(input: DateInput): number;
|
|
164
|
+
export declare function getAge(input: DateInput): number;
|
|
165
|
+
export declare function clamp(input: DateInput, min: DateInput, max: DateInput): Date;
|
|
166
|
+
export declare function min(...inputs: DateInput[]): Date;
|
|
167
|
+
export declare function max(...inputs: DateInput[]): Date;
|
|
168
|
+
export declare function roundToNearestMinutes(input: DateInput, intervalMinutes: number): Date;
|
|
169
|
+
/** Parse a date string in DD/MM/YYYY format */
|
|
170
|
+
export declare function parseDDMMYYYY(str: string): Date;
|
|
171
|
+
/** Parse a date string in MM/DD/YYYY format */
|
|
172
|
+
export declare function parseMMDDYYYY(str: string): Date;
|
|
173
|
+
/** Parse a date string in YYYY-MM-DD format */
|
|
174
|
+
export declare function parseYYYYMMDD(str: string): Date;
|
|
175
|
+
/** Parse any recognisable date string */
|
|
176
|
+
export declare function parseAny(str: string): Date;
|
|
177
|
+
/** Convert a date to a specific IANA timezone string */
|
|
178
|
+
export declare function toTimezone(input: DateInput, timezone: string): string;
|
|
179
|
+
/** Get the UTC offset string for a timezone, e.g. '+05:30' */
|
|
180
|
+
export declare function getTimezoneOffset(timezone: string): string;
|
|
181
|
+
export declare function now(): Date;
|
|
182
|
+
export declare function today(): Date;
|
|
183
|
+
export declare function tomorrow(): Date;
|
|
184
|
+
export declare function yesterday(): Date;
|
|
185
|
+
/** @deprecated Use isValidDate() instead */
|
|
186
|
+
export declare function datetest(): boolean;
|
|
187
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../lib/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,MAAM,MAAM,SAAS,GAAG,IAAI,GAAG,MAAM,GAAG,MAAM,CAAC;AAE/C,MAAM,WAAW,QAAQ;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,MAAM,MAAM,GAAG,MAAM,CAAC;AAE5B,MAAM,MAAM,SAAS,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,WAAW,GAAG,UAAU,GAAG,QAAQ,GAAG,UAAU,CAAC;AAI3G;;GAEG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,SAAS,GAAG,IAAI,CAM7C;AAID,yDAAyD;AACzD,wBAAgB,WAAW,CAAC,KAAK,EAAE,SAAS,GAAG,OAAO,CAMrD;AA2BD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAkFhE;AAID,kCAAkC;AAClC,wBAAgB,SAAS,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM,CAElD;AAED,sDAAsD;AACtD,wBAAgB,aAAa,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM,CAEtD;AAED,2DAA2D;AAC3D,wBAAgB,SAAS,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AM,GAAG,IAAI,CAG/C;AAED,yCAAyC;AACzC,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAwB;AAInE,wDAAwD;AACxD,wBAAgB,UAAU,CAAC,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAErE;AAED,8DAA8D;AAC9D,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAQ1D;AAID,wBAAgB,GAAG,IAAI,IAAI,CAA6B;AACxD,wBAAgB,KAAK,IAAI,IAAI,CAAuC;AACpE,wBAAgB,QAAQ,IAAI,IAAI,CAAgD;AAChF,wBAAgB,SAAS,IAAI,IAAI,CAAgD;AAGjF,4CAA4C;AAC5C,wBAAgB,QAAQ,IAAI,OAAO,CAAiB"}
|
package/dist/index.js
CHANGED
|
@@ -1,13 +1,680 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
exports.
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* utilsfordate - Comprehensive Date Utility Library
|
|
4
|
+
* Supports all major date formats, parsing, formatting, manipulation, and validation.
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.toDate = toDate;
|
|
8
|
+
exports.isValidDate = isValidDate;
|
|
9
|
+
exports.format = format;
|
|
10
|
+
exports.toISODate = toISODate;
|
|
11
|
+
exports.toISODateTime = toISODateTime;
|
|
12
|
+
exports.toISOFull = toISOFull;
|
|
13
|
+
exports.toUSShort = toUSShort;
|
|
14
|
+
exports.toEUShort = toEUShort;
|
|
15
|
+
exports.toUSLong = toUSLong;
|
|
16
|
+
exports.toEULong = toEULong;
|
|
17
|
+
exports.toShortMonth = toShortMonth;
|
|
18
|
+
exports.toFullWithWeekday = toFullWithWeekday;
|
|
19
|
+
exports.toRFC1123Date = toRFC1123Date;
|
|
20
|
+
exports.toRFC2822 = toRFC2822;
|
|
21
|
+
exports.toTimeShort = toTimeShort;
|
|
22
|
+
exports.toTimeLong = toTimeLong;
|
|
23
|
+
exports.toTime12h = toTime12h;
|
|
24
|
+
exports.toTimeWithMs = toTimeWithMs;
|
|
25
|
+
exports.toUnixTimestamp = toUnixTimestamp;
|
|
26
|
+
exports.toUnixMs = toUnixMs;
|
|
27
|
+
exports.toQuarter = toQuarter;
|
|
28
|
+
exports.toISOWeek = toISOWeek;
|
|
29
|
+
exports.toLocaleString = toLocaleString;
|
|
30
|
+
exports.toLocaleDate = toLocaleDate;
|
|
31
|
+
exports.toLocaleTime = toLocaleTime;
|
|
32
|
+
exports.fromNow = fromNow;
|
|
33
|
+
exports.durationBetween = durationBetween;
|
|
34
|
+
exports.diff = diff;
|
|
35
|
+
exports.diffInDays = diffInDays;
|
|
36
|
+
exports.diffInMonths = diffInMonths;
|
|
37
|
+
exports.diffInYears = diffInYears;
|
|
38
|
+
exports.addMilliseconds = addMilliseconds;
|
|
39
|
+
exports.addSeconds = addSeconds;
|
|
40
|
+
exports.addMinutes = addMinutes;
|
|
41
|
+
exports.addHours = addHours;
|
|
42
|
+
exports.addDays = addDays;
|
|
43
|
+
exports.addWeeks = addWeeks;
|
|
44
|
+
exports.addMonths = addMonths;
|
|
45
|
+
exports.addYears = addYears;
|
|
46
|
+
exports.subtractDays = subtractDays;
|
|
47
|
+
exports.subtractMonths = subtractMonths;
|
|
48
|
+
exports.subtractYears = subtractYears;
|
|
49
|
+
exports.startOfDay = startOfDay;
|
|
50
|
+
exports.endOfDay = endOfDay;
|
|
51
|
+
exports.startOfMonth = startOfMonth;
|
|
52
|
+
exports.endOfMonth = endOfMonth;
|
|
53
|
+
exports.startOfYear = startOfYear;
|
|
54
|
+
exports.endOfYear = endOfYear;
|
|
55
|
+
exports.startOfWeek = startOfWeek;
|
|
56
|
+
exports.endOfWeek = endOfWeek;
|
|
57
|
+
exports.startOfHour = startOfHour;
|
|
58
|
+
exports.endOfHour = endOfHour;
|
|
59
|
+
exports.startOfMinute = startOfMinute;
|
|
60
|
+
exports.endOfMinute = endOfMinute;
|
|
61
|
+
exports.startOfQuarter = startOfQuarter;
|
|
62
|
+
exports.endOfQuarter = endOfQuarter;
|
|
63
|
+
exports.isBefore = isBefore;
|
|
64
|
+
exports.isAfter = isAfter;
|
|
65
|
+
exports.isSameDay = isSameDay;
|
|
66
|
+
exports.isSameMonth = isSameMonth;
|
|
67
|
+
exports.isSameYear = isSameYear;
|
|
68
|
+
exports.isToday = isToday;
|
|
69
|
+
exports.isYesterday = isYesterday;
|
|
70
|
+
exports.isTomorrow = isTomorrow;
|
|
71
|
+
exports.isPast = isPast;
|
|
72
|
+
exports.isFuture = isFuture;
|
|
73
|
+
exports.isWeekend = isWeekend;
|
|
74
|
+
exports.isWeekday = isWeekday;
|
|
75
|
+
exports.isLeapYear = isLeapYear;
|
|
76
|
+
exports.isBetween = isBetween;
|
|
77
|
+
exports.getDayOfYear = getDayOfYear;
|
|
78
|
+
exports.getDaysInMonth = getDaysInMonth;
|
|
79
|
+
exports.getDaysInYear = getDaysInYear;
|
|
80
|
+
exports.getWeekNumber = getWeekNumber;
|
|
81
|
+
exports.getQuarter = getQuarter;
|
|
82
|
+
exports.getAge = getAge;
|
|
83
|
+
exports.clamp = clamp;
|
|
84
|
+
exports.min = min;
|
|
85
|
+
exports.max = max;
|
|
86
|
+
exports.roundToNearestMinutes = roundToNearestMinutes;
|
|
87
|
+
exports.parseDDMMYYYY = parseDDMMYYYY;
|
|
88
|
+
exports.parseMMDDYYYY = parseMMDDYYYY;
|
|
89
|
+
exports.parseYYYYMMDD = parseYYYYMMDD;
|
|
90
|
+
exports.parseAny = parseAny;
|
|
91
|
+
exports.toTimezone = toTimezone;
|
|
92
|
+
exports.getTimezoneOffset = getTimezoneOffset;
|
|
93
|
+
exports.now = now;
|
|
94
|
+
exports.today = today;
|
|
95
|
+
exports.tomorrow = tomorrow;
|
|
96
|
+
exports.yesterday = yesterday;
|
|
97
|
+
exports.datetest = datetest;
|
|
98
|
+
// ─── Normalisation ────────────────────────────────────────────────────────────
|
|
99
|
+
/**
|
|
100
|
+
* Normalise any DateInput to a native Date object.
|
|
101
|
+
*/
|
|
102
|
+
function toDate(input) {
|
|
103
|
+
if (input instanceof Date)
|
|
104
|
+
return new Date(input.getTime());
|
|
105
|
+
if (typeof input === 'number')
|
|
106
|
+
return new Date(input);
|
|
107
|
+
const d = new Date(input);
|
|
108
|
+
if (isNaN(d.getTime()))
|
|
109
|
+
throw new RangeError(`Invalid date input: "${input}"`);
|
|
110
|
+
return d;
|
|
111
|
+
}
|
|
112
|
+
// ─── Validation ───────────────────────────────────────────────────────────────
|
|
113
|
+
/** Returns true if the input represents a valid date. */
|
|
114
|
+
function isValidDate(input) {
|
|
115
|
+
try {
|
|
116
|
+
return !isNaN(toDate(input).getTime());
|
|
117
|
+
}
|
|
118
|
+
catch (_a) {
|
|
119
|
+
return false;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
// ─── Core Formatting ─────────────────────────────────────────────────────────
|
|
123
|
+
const MONTH_NAMES_FULL = [
|
|
124
|
+
'January', 'February', 'March', 'April', 'May', 'June',
|
|
125
|
+
'July', 'August', 'September', 'October', 'November', 'December'
|
|
126
|
+
];
|
|
127
|
+
const MONTH_NAMES_SHORT = [
|
|
128
|
+
'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
|
|
129
|
+
'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'
|
|
130
|
+
];
|
|
131
|
+
const DAY_NAMES_FULL = [
|
|
132
|
+
'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'
|
|
133
|
+
];
|
|
134
|
+
const DAY_NAMES_SHORT = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
|
|
135
|
+
function pad(n, width = 2) {
|
|
136
|
+
return String(n).padStart(width, '0');
|
|
137
|
+
}
|
|
138
|
+
function getOrdinal(n) {
|
|
139
|
+
const s = ['th', 'st', 'nd', 'rd'];
|
|
140
|
+
const v = n % 100;
|
|
141
|
+
return n + (s[(v - 20) % 10] || s[v] || s[0]);
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Low-level token-based formatter.
|
|
145
|
+
*
|
|
146
|
+
* Supported tokens:
|
|
147
|
+
*
|
|
148
|
+
* | Token | Output example | Description |
|
|
149
|
+
* |--------|-----------------------|-------------------------------------|
|
|
150
|
+
* | YYYY | 2024 | 4-digit year |
|
|
151
|
+
* | YY | 24 | 2-digit year |
|
|
152
|
+
* | MMMM | January | Full month name |
|
|
153
|
+
* | MMM | Jan | Short month name |
|
|
154
|
+
* | MM | 01–12 | Zero-padded month |
|
|
155
|
+
* | M | 1–12 | Month (no pad) |
|
|
156
|
+
* | DDDD | Monday | Full weekday name |
|
|
157
|
+
* | DDD | Mon | Short weekday name |
|
|
158
|
+
* | DD | 01–31 | Zero-padded day |
|
|
159
|
+
* | D | 1–31 | Day (no pad) |
|
|
160
|
+
* | Do | 1st, 2nd … | Ordinal day |
|
|
161
|
+
* | HH | 00–23 | Zero-padded 24-hour |
|
|
162
|
+
* | H | 0–23 | 24-hour (no pad) |
|
|
163
|
+
* | hh | 01–12 | Zero-padded 12-hour |
|
|
164
|
+
* | h | 1–12 | 12-hour (no pad) |
|
|
165
|
+
* | mm | 00–59 | Zero-padded minutes |
|
|
166
|
+
* | m | 0–59 | Minutes (no pad) |
|
|
167
|
+
* | ss | 00–59 | Zero-padded seconds |
|
|
168
|
+
* | s | 0–59 | Seconds (no pad) |
|
|
169
|
+
* | SSS | 000–999 | Milliseconds |
|
|
170
|
+
* | A | AM / PM | Upper-case meridiem |
|
|
171
|
+
* | a | am / pm | Lower-case meridiem |
|
|
172
|
+
* | Z | +05:30 | UTC offset ±HH:MM |
|
|
173
|
+
* | ZZ | +0530 | UTC offset ±HHMM |
|
|
174
|
+
* | X | 1714000000 | Unix timestamp (seconds) |
|
|
175
|
+
* | x | 1714000000000 | Unix timestamp (ms) |
|
|
176
|
+
* | Q | 1–4 | Quarter |
|
|
177
|
+
* | W | 1–53 | ISO week number |
|
|
178
|
+
* | [text] | text | Literal escape |
|
|
179
|
+
*/
|
|
180
|
+
function format(input, pattern) {
|
|
181
|
+
const d = toDate(input);
|
|
182
|
+
const year = d.getFullYear();
|
|
183
|
+
const month = d.getMonth();
|
|
184
|
+
const day = d.getDate();
|
|
185
|
+
const weekday = d.getDay();
|
|
186
|
+
const hours = d.getHours();
|
|
187
|
+
const minutes = d.getMinutes();
|
|
188
|
+
const seconds = d.getSeconds();
|
|
189
|
+
const ms = d.getMilliseconds();
|
|
190
|
+
const hours12 = hours % 12 || 12;
|
|
191
|
+
const offsetMin = -d.getTimezoneOffset();
|
|
192
|
+
const offsetSign = offsetMin >= 0 ? '+' : '-';
|
|
193
|
+
const absOff = Math.abs(offsetMin);
|
|
194
|
+
const offH = pad(Math.floor(absOff / 60));
|
|
195
|
+
const offM = pad(absOff % 60);
|
|
196
|
+
function isoWeek(date) {
|
|
197
|
+
const tmp = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate()));
|
|
198
|
+
tmp.setUTCDate(tmp.getUTCDate() + 4 - (tmp.getUTCDay() || 7));
|
|
199
|
+
const yearStart = new Date(Date.UTC(tmp.getUTCFullYear(), 0, 1));
|
|
200
|
+
return Math.ceil(((tmp.getTime() - yearStart.getTime()) / 86400000 + 1) / 7);
|
|
201
|
+
}
|
|
202
|
+
const tokens = [];
|
|
203
|
+
let i = 0;
|
|
204
|
+
while (i < pattern.length) {
|
|
205
|
+
if (pattern[i] === '[') {
|
|
206
|
+
const end = pattern.indexOf(']', i);
|
|
207
|
+
if (end === -1)
|
|
208
|
+
throw new Error('Unterminated escape bracket in pattern');
|
|
209
|
+
tokens.push({ raw: true, value: pattern.slice(i + 1, end) });
|
|
210
|
+
i = end + 1;
|
|
211
|
+
}
|
|
212
|
+
else {
|
|
213
|
+
const slice = pattern.slice(i);
|
|
214
|
+
const match = slice.match(/^(YYYY|YY|MMMM|MMM|MM|M|DDDD|DDD|DD|Do|D|HH|H|hh|h|mm|m|ss|s|SSS|A|a|ZZ|Z|X|x|Q|W)/);
|
|
215
|
+
if (match) {
|
|
216
|
+
tokens.push({ raw: false, value: match[1] });
|
|
217
|
+
i += match[1].length;
|
|
218
|
+
}
|
|
219
|
+
else {
|
|
220
|
+
tokens.push({ raw: true, value: pattern[i] });
|
|
221
|
+
i++;
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
return tokens.map(t => {
|
|
226
|
+
if (t.raw)
|
|
227
|
+
return t.value;
|
|
228
|
+
switch (t.value) {
|
|
229
|
+
case 'YYYY': return String(year);
|
|
230
|
+
case 'YY': return String(year).slice(-2);
|
|
231
|
+
case 'MMMM': return MONTH_NAMES_FULL[month];
|
|
232
|
+
case 'MMM': return MONTH_NAMES_SHORT[month];
|
|
233
|
+
case 'MM': return pad(month + 1);
|
|
234
|
+
case 'M': return String(month + 1);
|
|
235
|
+
case 'DDDD': return DAY_NAMES_FULL[weekday];
|
|
236
|
+
case 'DDD': return DAY_NAMES_SHORT[weekday];
|
|
237
|
+
case 'DD': return pad(day);
|
|
238
|
+
case 'Do': return getOrdinal(day);
|
|
239
|
+
case 'D': return String(day);
|
|
240
|
+
case 'HH': return pad(hours);
|
|
241
|
+
case 'H': return String(hours);
|
|
242
|
+
case 'hh': return pad(hours12);
|
|
243
|
+
case 'h': return String(hours12);
|
|
244
|
+
case 'mm': return pad(minutes);
|
|
245
|
+
case 'm': return String(minutes);
|
|
246
|
+
case 'ss': return pad(seconds);
|
|
247
|
+
case 's': return String(seconds);
|
|
248
|
+
case 'SSS': return pad(ms, 3);
|
|
249
|
+
case 'A': return hours < 12 ? 'AM' : 'PM';
|
|
250
|
+
case 'a': return hours < 12 ? 'am' : 'pm';
|
|
251
|
+
case 'Z': return `${offsetSign}${offH}:${offM}`;
|
|
252
|
+
case 'ZZ': return `${offsetSign}${offH}${offM}`;
|
|
253
|
+
case 'X': return String(Math.floor(d.getTime() / 1000));
|
|
254
|
+
case 'x': return String(d.getTime());
|
|
255
|
+
case 'Q': return String(Math.ceil((month + 1) / 3));
|
|
256
|
+
case 'W': return String(isoWeek(d));
|
|
257
|
+
default: return t.value;
|
|
258
|
+
}
|
|
259
|
+
}).join('');
|
|
260
|
+
}
|
|
261
|
+
// ─── Preset Format Helpers ────────────────────────────────────────────────────
|
|
262
|
+
/** 2024-01-15 (ISO 8601 date) */
|
|
263
|
+
function toISODate(input) {
|
|
264
|
+
return format(input, 'YYYY-MM-DD');
|
|
265
|
+
}
|
|
266
|
+
/** 2024-01-15T14:30:00 (ISO 8601 datetime, local) */
|
|
267
|
+
function toISODateTime(input) {
|
|
268
|
+
return format(input, 'YYYY-MM-DD[T]HH:mm:ss');
|
|
269
|
+
}
|
|
270
|
+
/** Full ISO 8601 with offset: 2024-01-15T14:30:00+05:30 */
|
|
271
|
+
function toISOFull(input) {
|
|
272
|
+
return format(input, 'YYYY-MM-DD[T]HH:mm:ssZ');
|
|
273
|
+
}
|
|
274
|
+
/** 01/15/2024 (US short) */
|
|
275
|
+
function toUSShort(input) {
|
|
276
|
+
return format(input, 'MM/DD/YYYY');
|
|
277
|
+
}
|
|
278
|
+
/** 15/01/2024 (EU short) */
|
|
279
|
+
function toEUShort(input) {
|
|
280
|
+
return format(input, 'DD/MM/YYYY');
|
|
281
|
+
}
|
|
282
|
+
/** January 15, 2024 (US long) */
|
|
283
|
+
function toUSLong(input) {
|
|
284
|
+
return format(input, 'MMMM D, YYYY');
|
|
285
|
+
}
|
|
286
|
+
/** 15 January 2024 (EU long) */
|
|
287
|
+
function toEULong(input) {
|
|
288
|
+
return format(input, 'D MMMM YYYY');
|
|
289
|
+
}
|
|
290
|
+
/** Jan 15, 2024 */
|
|
291
|
+
function toShortMonth(input) {
|
|
292
|
+
return format(input, 'MMM D, YYYY');
|
|
293
|
+
}
|
|
294
|
+
/** Monday, January 15, 2024 */
|
|
295
|
+
function toFullWithWeekday(input) {
|
|
296
|
+
return format(input, 'DDDD, MMMM D, YYYY');
|
|
297
|
+
}
|
|
298
|
+
/** Mon, 15 Jan 2024 */
|
|
299
|
+
function toRFC1123Date(input) {
|
|
300
|
+
return format(input, 'DDD, DD MMM YYYY');
|
|
301
|
+
}
|
|
302
|
+
/** Mon, 15 Jan 2024 14:30:00 +0000 (RFC 2822 / email) */
|
|
303
|
+
function toRFC2822(input) {
|
|
304
|
+
const d = toDate(input);
|
|
305
|
+
const utc = new Date(d.getTime() + d.getTimezoneOffset() * 60000);
|
|
306
|
+
return format(utc, 'DDD, DD MMM YYYY HH:mm:ss') + ' +0000';
|
|
307
|
+
}
|
|
308
|
+
/** 14:30 (HH:mm) */
|
|
309
|
+
function toTimeShort(input) {
|
|
310
|
+
return format(input, 'HH:mm');
|
|
311
|
+
}
|
|
312
|
+
/** 14:30:00 (HH:mm:ss) */
|
|
313
|
+
function toTimeLong(input) {
|
|
314
|
+
return format(input, 'HH:mm:ss');
|
|
315
|
+
}
|
|
316
|
+
/** 2:30 PM (12-hour) */
|
|
317
|
+
function toTime12h(input) {
|
|
318
|
+
return format(input, 'h:mm A');
|
|
319
|
+
}
|
|
320
|
+
/** 14:30:00.123 (with ms) */
|
|
321
|
+
function toTimeWithMs(input) {
|
|
322
|
+
return format(input, 'HH:mm:ss.SSS');
|
|
323
|
+
}
|
|
324
|
+
/** Unix timestamp in seconds */
|
|
325
|
+
function toUnixTimestamp(input) {
|
|
326
|
+
return Math.floor(toDate(input).getTime() / 1000);
|
|
327
|
+
}
|
|
328
|
+
/** Unix timestamp in milliseconds */
|
|
329
|
+
function toUnixMs(input) {
|
|
330
|
+
return toDate(input).getTime();
|
|
331
|
+
}
|
|
332
|
+
/** Q1 2024 */
|
|
333
|
+
function toQuarter(input) {
|
|
334
|
+
return format(input, '[Q]Q YYYY');
|
|
335
|
+
}
|
|
336
|
+
/** 2024-W03 (ISO week) */
|
|
337
|
+
function toISOWeek(input) {
|
|
338
|
+
return format(input, 'YYYY-[W]W');
|
|
339
|
+
}
|
|
340
|
+
/** Locale-aware formatting using Intl.DateTimeFormat */
|
|
341
|
+
function toLocaleString(input, locale = 'en-US', options) {
|
|
342
|
+
return toDate(input).toLocaleString(locale, options);
|
|
343
|
+
}
|
|
344
|
+
/** Locale date only */
|
|
345
|
+
function toLocaleDate(input, locale = 'en-US') {
|
|
346
|
+
return toDate(input).toLocaleDateString(locale);
|
|
347
|
+
}
|
|
348
|
+
/** Locale time only */
|
|
349
|
+
function toLocaleTime(input, locale = 'en-US') {
|
|
350
|
+
return toDate(input).toLocaleTimeString(locale);
|
|
351
|
+
}
|
|
352
|
+
// ─── Relative / Human-readable ───────────────────────────────────────────────
|
|
353
|
+
/**
|
|
354
|
+
* Returns a human-readable relative string, e.g. "3 days ago", "in 2 hours".
|
|
355
|
+
*/
|
|
356
|
+
function fromNow(input, locale = 'en-US') {
|
|
357
|
+
const diff = toDate(input).getTime() - Date.now();
|
|
358
|
+
const absDiff = Math.abs(diff);
|
|
359
|
+
const future = diff > 0;
|
|
360
|
+
const MINUTE = 60 * 1000;
|
|
361
|
+
const HOUR = 60 * MINUTE;
|
|
362
|
+
const DAY = 24 * HOUR;
|
|
363
|
+
const WEEK = 7 * DAY;
|
|
364
|
+
const MONTH = 30 * DAY;
|
|
365
|
+
const YEAR = 365 * DAY;
|
|
366
|
+
let value;
|
|
367
|
+
let unit;
|
|
368
|
+
if (absDiff < MINUTE) {
|
|
369
|
+
value = Math.round(absDiff / 1000);
|
|
370
|
+
unit = 'second';
|
|
371
|
+
}
|
|
372
|
+
else if (absDiff < HOUR) {
|
|
373
|
+
value = Math.round(absDiff / MINUTE);
|
|
374
|
+
unit = 'minute';
|
|
375
|
+
}
|
|
376
|
+
else if (absDiff < DAY) {
|
|
377
|
+
value = Math.round(absDiff / HOUR);
|
|
378
|
+
unit = 'hour';
|
|
379
|
+
}
|
|
380
|
+
else if (absDiff < WEEK) {
|
|
381
|
+
value = Math.round(absDiff / DAY);
|
|
382
|
+
unit = 'day';
|
|
383
|
+
}
|
|
384
|
+
else if (absDiff < MONTH) {
|
|
385
|
+
value = Math.round(absDiff / WEEK);
|
|
386
|
+
unit = 'week';
|
|
387
|
+
}
|
|
388
|
+
else if (absDiff < YEAR) {
|
|
389
|
+
value = Math.round(absDiff / MONTH);
|
|
390
|
+
unit = 'month';
|
|
391
|
+
}
|
|
392
|
+
else {
|
|
393
|
+
value = Math.round(absDiff / YEAR);
|
|
394
|
+
unit = 'year';
|
|
395
|
+
}
|
|
396
|
+
try {
|
|
397
|
+
const rtf = new Intl.RelativeTimeFormat(locale, { numeric: 'auto' });
|
|
398
|
+
return rtf.format(future ? value : -value, unit);
|
|
399
|
+
}
|
|
400
|
+
catch (_a) {
|
|
401
|
+
const label = `${value} ${unit}${value !== 1 ? 's' : ''}`;
|
|
402
|
+
return future ? `in ${label}` : `${label} ago`;
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
/** Duration between two dates as a readable string, e.g. "3 days, 2 hours". */
|
|
406
|
+
function durationBetween(a, b) {
|
|
407
|
+
const diff = Math.abs(toDate(b).getTime() - toDate(a).getTime());
|
|
408
|
+
const days = Math.floor(diff / 86400000);
|
|
409
|
+
const hours = Math.floor((diff % 86400000) / 3600000);
|
|
410
|
+
const minutes = Math.floor((diff % 3600000) / 60000);
|
|
411
|
+
const seconds = Math.floor((diff % 60000) / 1000);
|
|
412
|
+
const parts = [];
|
|
413
|
+
if (days)
|
|
414
|
+
parts.push(`${days} day${days !== 1 ? 's' : ''}`);
|
|
415
|
+
if (hours)
|
|
416
|
+
parts.push(`${hours} hour${hours !== 1 ? 's' : ''}`);
|
|
417
|
+
if (minutes)
|
|
418
|
+
parts.push(`${minutes} minute${minutes !== 1 ? 's' : ''}`);
|
|
419
|
+
if (seconds)
|
|
420
|
+
parts.push(`${seconds} second${seconds !== 1 ? 's' : ''}`);
|
|
421
|
+
return parts.length ? parts.join(', ') : '0 seconds';
|
|
422
|
+
}
|
|
423
|
+
// ─── Diff ─────────────────────────────────────────────────────────────────────
|
|
424
|
+
/** Returns the full structured difference between two dates. */
|
|
425
|
+
function diff(a, b) {
|
|
426
|
+
const ms = Math.abs(toDate(b).getTime() - toDate(a).getTime());
|
|
427
|
+
const totalSeconds = Math.floor(ms / 1000);
|
|
428
|
+
return {
|
|
429
|
+
years: Math.floor(ms / (365.25 * 24 * 3600 * 1000)),
|
|
430
|
+
months: Math.floor(ms / (30.44 * 24 * 3600 * 1000)),
|
|
431
|
+
weeks: Math.floor(ms / (7 * 24 * 3600 * 1000)),
|
|
432
|
+
days: Math.floor(ms / (24 * 3600 * 1000)),
|
|
433
|
+
hours: Math.floor(ms / (3600 * 1000)),
|
|
434
|
+
minutes: Math.floor(ms / 60000),
|
|
435
|
+
seconds: totalSeconds,
|
|
436
|
+
milliseconds: ms,
|
|
437
|
+
};
|
|
438
|
+
}
|
|
439
|
+
/** Difference in whole days (negative if a > b). */
|
|
440
|
+
function diffInDays(a, b) {
|
|
441
|
+
return Math.round((toDate(b).getTime() - toDate(a).getTime()) / 86400000);
|
|
442
|
+
}
|
|
443
|
+
/** Difference in whole months. */
|
|
444
|
+
function diffInMonths(a, b) {
|
|
445
|
+
const da = toDate(a), db = toDate(b);
|
|
446
|
+
return (db.getFullYear() - da.getFullYear()) * 12 + (db.getMonth() - da.getMonth());
|
|
447
|
+
}
|
|
448
|
+
/** Difference in whole years. */
|
|
449
|
+
function diffInYears(a, b) {
|
|
450
|
+
return Math.floor(diffInMonths(a, b) / 12);
|
|
451
|
+
}
|
|
452
|
+
// ─── Manipulation ─────────────────────────────────────────────────────────────
|
|
453
|
+
function addMilliseconds(input, amount) {
|
|
454
|
+
return new Date(toDate(input).getTime() + amount);
|
|
455
|
+
}
|
|
456
|
+
function addSeconds(input, amount) {
|
|
457
|
+
return addMilliseconds(input, amount * 1000);
|
|
458
|
+
}
|
|
459
|
+
function addMinutes(input, amount) {
|
|
460
|
+
return addMilliseconds(input, amount * 60000);
|
|
461
|
+
}
|
|
462
|
+
function addHours(input, amount) {
|
|
463
|
+
return addMilliseconds(input, amount * 3600000);
|
|
464
|
+
}
|
|
465
|
+
function addDays(input, amount) {
|
|
466
|
+
const d = toDate(input);
|
|
467
|
+
d.setDate(d.getDate() + amount);
|
|
468
|
+
return d;
|
|
469
|
+
}
|
|
470
|
+
function addWeeks(input, amount) {
|
|
471
|
+
return addDays(input, amount * 7);
|
|
472
|
+
}
|
|
473
|
+
function addMonths(input, amount) {
|
|
474
|
+
const d = toDate(input);
|
|
475
|
+
const day = d.getDate();
|
|
476
|
+
d.setMonth(d.getMonth() + amount);
|
|
477
|
+
if (d.getDate() !== day)
|
|
478
|
+
d.setDate(0);
|
|
479
|
+
return d;
|
|
480
|
+
}
|
|
481
|
+
function addYears(input, amount) {
|
|
482
|
+
return addMonths(input, amount * 12);
|
|
483
|
+
}
|
|
484
|
+
function subtractDays(input, amount) { return addDays(input, -amount); }
|
|
485
|
+
function subtractMonths(input, amount) { return addMonths(input, -amount); }
|
|
486
|
+
function subtractYears(input, amount) { return addYears(input, -amount); }
|
|
487
|
+
// ─── Start / End of Period ────────────────────────────────────────────────────
|
|
488
|
+
function startOfDay(input) {
|
|
489
|
+
const d = toDate(input);
|
|
490
|
+
d.setHours(0, 0, 0, 0);
|
|
491
|
+
return d;
|
|
492
|
+
}
|
|
493
|
+
function endOfDay(input) {
|
|
494
|
+
const d = toDate(input);
|
|
495
|
+
d.setHours(23, 59, 59, 999);
|
|
496
|
+
return d;
|
|
497
|
+
}
|
|
498
|
+
function startOfMonth(input) {
|
|
499
|
+
const d = toDate(input);
|
|
500
|
+
d.setDate(1);
|
|
501
|
+
d.setHours(0, 0, 0, 0);
|
|
502
|
+
return d;
|
|
503
|
+
}
|
|
504
|
+
function endOfMonth(input) {
|
|
505
|
+
const d = toDate(input);
|
|
506
|
+
d.setMonth(d.getMonth() + 1, 0);
|
|
507
|
+
d.setHours(23, 59, 59, 999);
|
|
508
|
+
return d;
|
|
509
|
+
}
|
|
510
|
+
function startOfYear(input) {
|
|
511
|
+
const d = toDate(input);
|
|
512
|
+
d.setMonth(0, 1);
|
|
513
|
+
d.setHours(0, 0, 0, 0);
|
|
514
|
+
return d;
|
|
515
|
+
}
|
|
516
|
+
function endOfYear(input) {
|
|
517
|
+
const d = toDate(input);
|
|
518
|
+
d.setMonth(11, 31);
|
|
519
|
+
d.setHours(23, 59, 59, 999);
|
|
520
|
+
return d;
|
|
521
|
+
}
|
|
522
|
+
function startOfWeek(input, weekStartsOn = 0) {
|
|
523
|
+
const d = toDate(input);
|
|
524
|
+
const day = d.getDay();
|
|
525
|
+
const diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
|
|
526
|
+
d.setDate(d.getDate() - diff);
|
|
527
|
+
d.setHours(0, 0, 0, 0);
|
|
528
|
+
return d;
|
|
529
|
+
}
|
|
530
|
+
function endOfWeek(input, weekStartsOn = 0) {
|
|
531
|
+
const d = startOfWeek(input, weekStartsOn);
|
|
532
|
+
d.setDate(d.getDate() + 6);
|
|
533
|
+
d.setHours(23, 59, 59, 999);
|
|
534
|
+
return d;
|
|
535
|
+
}
|
|
536
|
+
function startOfHour(input) {
|
|
537
|
+
const d = toDate(input);
|
|
538
|
+
d.setMinutes(0, 0, 0);
|
|
539
|
+
return d;
|
|
540
|
+
}
|
|
541
|
+
function endOfHour(input) {
|
|
542
|
+
const d = toDate(input);
|
|
543
|
+
d.setMinutes(59, 59, 999);
|
|
544
|
+
return d;
|
|
545
|
+
}
|
|
546
|
+
function startOfMinute(input) {
|
|
547
|
+
const d = toDate(input);
|
|
548
|
+
d.setSeconds(0, 0);
|
|
549
|
+
return d;
|
|
550
|
+
}
|
|
551
|
+
function endOfMinute(input) {
|
|
552
|
+
const d = toDate(input);
|
|
553
|
+
d.setSeconds(59, 999);
|
|
554
|
+
return d;
|
|
555
|
+
}
|
|
556
|
+
function startOfQuarter(input) {
|
|
557
|
+
const d = toDate(input);
|
|
558
|
+
d.setMonth(Math.floor(d.getMonth() / 3) * 3, 1);
|
|
559
|
+
d.setHours(0, 0, 0, 0);
|
|
560
|
+
return d;
|
|
561
|
+
}
|
|
562
|
+
function endOfQuarter(input) {
|
|
563
|
+
const d = toDate(input);
|
|
564
|
+
d.setMonth(Math.floor(d.getMonth() / 3) * 3 + 3, 0);
|
|
565
|
+
d.setHours(23, 59, 59, 999);
|
|
566
|
+
return d;
|
|
567
|
+
}
|
|
568
|
+
// ─── Comparison / Predicates ──────────────────────────────────────────────────
|
|
569
|
+
function isBefore(a, b) {
|
|
570
|
+
return toDate(a).getTime() < toDate(b).getTime();
|
|
571
|
+
}
|
|
572
|
+
function isAfter(a, b) {
|
|
573
|
+
return toDate(a).getTime() > toDate(b).getTime();
|
|
574
|
+
}
|
|
575
|
+
function isSameDay(a, b) {
|
|
576
|
+
const da = toDate(a), db = toDate(b);
|
|
577
|
+
return da.getFullYear() === db.getFullYear()
|
|
578
|
+
&& da.getMonth() === db.getMonth()
|
|
579
|
+
&& da.getDate() === db.getDate();
|
|
580
|
+
}
|
|
581
|
+
function isSameMonth(a, b) {
|
|
582
|
+
const da = toDate(a), db = toDate(b);
|
|
583
|
+
return da.getFullYear() === db.getFullYear() && da.getMonth() === db.getMonth();
|
|
584
|
+
}
|
|
585
|
+
function isSameYear(a, b) {
|
|
586
|
+
return toDate(a).getFullYear() === toDate(b).getFullYear();
|
|
587
|
+
}
|
|
588
|
+
function isToday(input) { return isSameDay(input, new Date()); }
|
|
589
|
+
function isYesterday(input) { return isSameDay(input, addDays(new Date(), -1)); }
|
|
590
|
+
function isTomorrow(input) { return isSameDay(input, addDays(new Date(), 1)); }
|
|
591
|
+
function isPast(input) { return toDate(input).getTime() < Date.now(); }
|
|
592
|
+
function isFuture(input) { return toDate(input).getTime() > Date.now(); }
|
|
593
|
+
function isWeekend(input) { const d = toDate(input).getDay(); return d === 0 || d === 6; }
|
|
594
|
+
function isWeekday(input) { return !isWeekend(input); }
|
|
595
|
+
function isLeapYear(input) {
|
|
596
|
+
const y = toDate(input).getFullYear();
|
|
597
|
+
return (y % 4 === 0 && y % 100 !== 0) || y % 400 === 0;
|
|
598
|
+
}
|
|
599
|
+
function isBetween(input, start, end, inclusive = true) {
|
|
600
|
+
const t = toDate(input).getTime();
|
|
601
|
+
const s = toDate(start).getTime();
|
|
602
|
+
const e = toDate(end).getTime();
|
|
603
|
+
return inclusive ? t >= s && t <= e : t > s && t < e;
|
|
604
|
+
}
|
|
605
|
+
// ─── Getters ──────────────────────────────────────────────────────────────────
|
|
606
|
+
function getDayOfYear(input) {
|
|
607
|
+
const d = toDate(input);
|
|
608
|
+
return Math.floor((d.getTime() - new Date(d.getFullYear(), 0, 0).getTime()) / 86400000);
|
|
609
|
+
}
|
|
610
|
+
function getDaysInMonth(input) {
|
|
611
|
+
const d = toDate(input);
|
|
612
|
+
return new Date(d.getFullYear(), d.getMonth() + 1, 0).getDate();
|
|
613
|
+
}
|
|
614
|
+
function getDaysInYear(input) { return isLeapYear(input) ? 366 : 365; }
|
|
615
|
+
function getWeekNumber(input) {
|
|
616
|
+
const d = toDate(input);
|
|
617
|
+
const tmp = new Date(Date.UTC(d.getFullYear(), d.getMonth(), d.getDate()));
|
|
618
|
+
tmp.setUTCDate(tmp.getUTCDate() + 4 - (tmp.getUTCDay() || 7));
|
|
619
|
+
const yearStart = new Date(Date.UTC(tmp.getUTCFullYear(), 0, 1));
|
|
620
|
+
return Math.ceil(((tmp.getTime() - yearStart.getTime()) / 86400000 + 1) / 7);
|
|
621
|
+
}
|
|
622
|
+
function getQuarter(input) { return Math.ceil((toDate(input).getMonth() + 1) / 3); }
|
|
623
|
+
function getAge(input) { return diffInYears(input, new Date()); }
|
|
624
|
+
// ─── Clamp / Nearest ──────────────────────────────────────────────────────────
|
|
625
|
+
function clamp(input, min, max) {
|
|
626
|
+
const t = toDate(input).getTime();
|
|
627
|
+
return new Date(Math.min(Math.max(t, toDate(min).getTime()), toDate(max).getTime()));
|
|
628
|
+
}
|
|
629
|
+
function min(...inputs) {
|
|
630
|
+
return new Date(Math.min(...inputs.map(i => toDate(i).getTime())));
|
|
631
|
+
}
|
|
632
|
+
function max(...inputs) {
|
|
633
|
+
return new Date(Math.max(...inputs.map(i => toDate(i).getTime())));
|
|
634
|
+
}
|
|
635
|
+
function roundToNearestMinutes(input, intervalMinutes) {
|
|
636
|
+
const ms = intervalMinutes * 60000;
|
|
637
|
+
return new Date(Math.round(toDate(input).getTime() / ms) * ms);
|
|
638
|
+
}
|
|
639
|
+
// ─── Parsing ──────────────────────────────────────────────────────────────────
|
|
640
|
+
/** Parse a date string in DD/MM/YYYY format */
|
|
641
|
+
function parseDDMMYYYY(str) {
|
|
642
|
+
const [d, m, y] = str.split('/').map(Number);
|
|
643
|
+
return new Date(y, m - 1, d);
|
|
644
|
+
}
|
|
645
|
+
/** Parse a date string in MM/DD/YYYY format */
|
|
646
|
+
function parseMMDDYYYY(str) {
|
|
647
|
+
const [m, d, y] = str.split('/').map(Number);
|
|
648
|
+
return new Date(y, m - 1, d);
|
|
649
|
+
}
|
|
650
|
+
/** Parse a date string in YYYY-MM-DD format */
|
|
651
|
+
function parseYYYYMMDD(str) {
|
|
652
|
+
const [y, m, d] = str.split('-').map(Number);
|
|
653
|
+
return new Date(y, m - 1, d);
|
|
654
|
+
}
|
|
655
|
+
/** Parse any recognisable date string */
|
|
656
|
+
function parseAny(str) { return toDate(str); }
|
|
657
|
+
// ─── Timezone Utilities ───────────────────────────────────────────────────────
|
|
658
|
+
/** Convert a date to a specific IANA timezone string */
|
|
659
|
+
function toTimezone(input, timezone) {
|
|
660
|
+
return toDate(input).toLocaleString('en-US', { timeZone: timezone });
|
|
661
|
+
}
|
|
662
|
+
/** Get the UTC offset string for a timezone, e.g. '+05:30' */
|
|
663
|
+
function getTimezoneOffset(timezone) {
|
|
664
|
+
const now = new Date();
|
|
665
|
+
const utcStr = now.toLocaleString('en-US', { timeZone: 'UTC' });
|
|
666
|
+
const tzStr = now.toLocaleString('en-US', { timeZone: timezone });
|
|
667
|
+
const diff = (new Date(tzStr).getTime() - new Date(utcStr).getTime()) / 60000;
|
|
668
|
+
const sign = diff >= 0 ? '+' : '-';
|
|
669
|
+
const abs = Math.abs(diff);
|
|
670
|
+
return `${sign}${pad(Math.floor(abs / 60))}:${pad(abs % 60)}`;
|
|
671
|
+
}
|
|
672
|
+
// ─── Convenience ─────────────────────────────────────────────────────────────
|
|
673
|
+
function now() { return new Date(); }
|
|
674
|
+
function today() { return startOfDay(new Date()); }
|
|
675
|
+
function tomorrow() { return startOfDay(addDays(new Date(), 1)); }
|
|
676
|
+
function yesterday() { return startOfDay(addDays(new Date(), -1)); }
|
|
677
|
+
// ─── Backwards-compatible export ─────────────────────────────────────────────
|
|
678
|
+
/** @deprecated Use isValidDate() instead */
|
|
679
|
+
function datetest() { return true; }
|
|
680
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../lib/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;AA0BH,wBAMC;AAKD,kCAMC;AAgED,wBAkFC;AAKD,8BAEC;AAGD,sCAEC;AAGD,8BAEC;AAGD,8BAEC;AAGD,8BAEC;AAGD,4BAEC;AAGD,4BAEC;AAGD,oCAEC;AAGD,8CAEC;AAGD,sCAEC;AAGD,8BAIC;AAGD,kCAEC;AAGD,gCAEC;AAGD,8BAEC;AAGD,oCAEC;AAGD,0CAEC;AAGD,4BAEC;AAGD,8BAEC;AAGD,8BAEC;AAGD,wCAMC;AAGD,oCAEC;AAGD,oCAEC;AAOD,0BA8BC;AAGD,0CAYC;AAKD,oBAaC;AAGD,gCAEC;AAGD,oCAGC;AAGD,kCAEC;AAID,0CAEC;AACD,gCAEC;AACD,gCAEC;AACD,4BAEC;AACD,0BAIC;AACD,4BAEC;AACD,8BAMC;AACD,4BAEC;AACD,oCAA2G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
|
3
|
-
"version": "
|
|
4
|
-
"description": "
|
|
5
|
-
"main": "index.js",
|
|
3
|
+
"version": "2.0.0",
|
|
4
|
+
"description": "Comprehensive date utility library — formatting, parsing, manipulation, diff, timezones and more",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"files": [
|
|
8
|
+
"dist",
|
|
9
|
+
"README.md",
|
|
10
|
+
"LICENSE"
|
|
11
|
+
],
|
|
6
12
|
"scripts": {
|
|
7
13
|
"build": "tsc",
|
|
8
|
-
"
|
|
14
|
+
"prepublishOnly": "npm run build"
|
|
9
15
|
},
|
|
16
|
+
"keywords": [
|
|
17
|
+
"date",
|
|
18
|
+
"utils",
|
|
19
|
+
"format",
|
|
20
|
+
"parse",
|
|
21
|
+
"datetime",
|
|
22
|
+
"timezone",
|
|
23
|
+
"typescript"
|
|
24
|
+
],
|
|
10
25
|
"repository": {
|
|
11
26
|
"type": "git",
|
|
12
27
|
"url": "https://github.com/harishnarayanan/dateutils.git"
|
|
@@ -14,10 +29,6 @@
|
|
|
14
29
|
"author": "Harish Narayanan",
|
|
15
30
|
"license": "ISC",
|
|
16
31
|
"devDependencies": {
|
|
17
|
-
"typescript": "^
|
|
18
|
-
},
|
|
19
|
-
"dependencies": {
|
|
20
|
-
"chai": "^4.2.0",
|
|
21
|
-
"mocha": "^5.2.0"
|
|
32
|
+
"typescript": "^5.4.0"
|
|
22
33
|
}
|
|
23
34
|
}
|
package/test/test.js
DELETED
package/tsconfig.json
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
/* Basic Options */
|
|
4
|
-
"target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'. */
|
|
5
|
-
"module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
|
|
6
|
-
// "lib": [], /* Specify library files to be included in the compilation. */
|
|
7
|
-
// "allowJs": true, /* Allow javascript files to be compiled. */
|
|
8
|
-
// "checkJs": true, /* Report errors in .js files. */
|
|
9
|
-
// "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */
|
|
10
|
-
"declaration": true, /* Generates corresponding '.d.ts' file. */
|
|
11
|
-
//"declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */
|
|
12
|
-
// "sourceMap": true, /* Generates corresponding '.map' file. */
|
|
13
|
-
// "outFile": "./", /* Concatenate and emit output to single file. */
|
|
14
|
-
"outDir": "./dist", /* Redirect output structure to the directory. */
|
|
15
|
-
// "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
|
|
16
|
-
// "composite": true, /* Enable project compilation */
|
|
17
|
-
// "removeComments": true, /* Do not emit comments to output. */
|
|
18
|
-
// "noEmit": true, /* Do not emit outputs. */
|
|
19
|
-
// "importHelpers": true, /* Import emit helpers from 'tslib'. */
|
|
20
|
-
// "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */
|
|
21
|
-
// "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */
|
|
22
|
-
|
|
23
|
-
/* Strict Type-Checking Options */
|
|
24
|
-
"strict": true, /* Enable all strict type-checking options. */
|
|
25
|
-
// "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */
|
|
26
|
-
// "strictNullChecks": true, /* Enable strict null checks. */
|
|
27
|
-
// "strictFunctionTypes": true, /* Enable strict checking of function types. */
|
|
28
|
-
// "strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */
|
|
29
|
-
// "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */
|
|
30
|
-
// "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */
|
|
31
|
-
// "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */
|
|
32
|
-
|
|
33
|
-
/* Additional Checks */
|
|
34
|
-
// "noUnusedLocals": true, /* Report errors on unused locals. */
|
|
35
|
-
// "noUnusedParameters": true, /* Report errors on unused parameters. */
|
|
36
|
-
// "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
|
|
37
|
-
// "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
|
|
38
|
-
|
|
39
|
-
/* Module Resolution Options */
|
|
40
|
-
// "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
|
|
41
|
-
// "baseUrl": "./", /* Base directory to resolve non-absolute module names. */
|
|
42
|
-
// "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
|
|
43
|
-
// "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */
|
|
44
|
-
// "typeRoots": [], /* List of folders to include type definitions from. */
|
|
45
|
-
// "types": [], /* Type declaration files to be included in compilation. */
|
|
46
|
-
// "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */
|
|
47
|
-
"esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
|
|
48
|
-
// "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */
|
|
49
|
-
|
|
50
|
-
/* Source Map Options */
|
|
51
|
-
// "sourceRoot": "", /* Specify the location where debugger should locate TypeScript files instead of source locations. */
|
|
52
|
-
// "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
|
|
53
|
-
// "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */
|
|
54
|
-
// "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */
|
|
55
|
-
|
|
56
|
-
/* Experimental Options */
|
|
57
|
-
// "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */
|
|
58
|
-
// "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */
|
|
59
|
-
}
|
|
60
|
-
}
|