@tsdotnet/date-time 1.0.23 → 1.0.27
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/LICENSE +21 -21
- package/README.md +11 -11
- package/dist/Calendars/Gregorian.d.ts +37 -37
- package/dist/ClockTime.d.ts +20 -20
- package/dist/ClockTime.js +67 -67
- package/dist/ClockTime.js.map +1 -1
- package/dist/DateTime.d.ts +154 -154
- package/dist/DateTime.js +305 -305
- package/dist/DateTime.js.map +1 -1
- package/dist/TimeQuantity.d.ts +50 -50
- package/dist/TimeQuantity.js +95 -95
- package/dist/TimeQuantity.js.map +1 -1
- package/dist/TimeSpan.d.ts +73 -73
- package/dist/TimeSpan.js +111 -111
- package/dist/TimeSpan.js.map +1 -1
- package/dist/TimeStamp.d.ts +25 -25
- package/dist/TimeStamp.js +45 -45
- package/dist/TimeStamp.js.map +1 -1
- package/dist/TimeUnit.d.ts +47 -47
- package/dist/TimeUnit.js +99 -99
- package/dist/TimeUnitValue.d.ts +19 -19
- package/dist/TimeUnitValue.js +46 -46
- package/dist/TimeUnitValue.js.map +1 -1
- package/dist/date-time.d.ts +20 -14
- package/dist/date-time.js +24 -24
- package/dist/date-time.js.map +1 -1
- package/dist-esm/ClockTime.js +62 -62
- package/dist-esm/ClockTime.js.map +1 -1
- package/dist-esm/DateTime.js +301 -301
- package/dist-esm/TimeQuantity.js +91 -91
- package/dist-esm/TimeSpan.js +106 -106
- package/dist-esm/TimeStamp.js +40 -40
- package/dist-esm/TimeUnit.js +96 -96
- package/dist-esm/TimeUnitValue.js +42 -42
- package/dist-esm/date-time.js +13 -13
- package/dist-esm/date-time.js.map +1 -1
- package/package.json +62 -62
- package/dist/CalendarDate.d.ts +0 -12
- package/dist/ClockTimeValue.d.ts +0 -14
- package/dist/DateTimeKind.d.ts +0 -15
- package/dist/JsDateConvertable.d.ts +0 -10
- package/dist/TimeMeasurement.d.ts +0 -15
- package/dist/TimeStampValue.d.ts +0 -13
- package/dist/howMany.d.ts +0 -59
package/dist/DateTime.js
CHANGED
|
@@ -1,306 +1,306 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*!
|
|
3
|
-
* @author electricessence / https://github.com/electricessence/
|
|
4
|
-
* Based on .NET DateTime's interface.
|
|
5
|
-
* @license MIT
|
|
6
|
-
*/
|
|
7
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
const tslib_1 = require("tslib");
|
|
9
|
-
const ArgumentNullException_1 = tslib_1.__importDefault(require("@tsdotnet/exceptions/dist/ArgumentNullException"));
|
|
10
|
-
const ClockTime_1 = tslib_1.__importDefault(require("./ClockTime"));
|
|
11
|
-
const TimeSpan_1 = tslib_1.__importDefault(require("./TimeSpan"));
|
|
12
|
-
const TimeStamp_1 = tslib_1.__importDefault(require("./TimeStamp"));
|
|
13
|
-
const VOID0 = void 0;
|
|
14
|
-
class DateTime {
|
|
15
|
-
constructor(value = new Date(), kind = 1 /* Local */) {
|
|
16
|
-
this._kind = kind;
|
|
17
|
-
if (value instanceof DateTime) {
|
|
18
|
-
this._value = value.toJsDate();
|
|
19
|
-
if (kind === VOID0)
|
|
20
|
-
this._kind = value._kind;
|
|
21
|
-
}
|
|
22
|
-
else { // noinspection SuspiciousInstanceOfGuard
|
|
23
|
-
if (value instanceof Date)
|
|
24
|
-
this._value = new Date(value.getTime());
|
|
25
|
-
else
|
|
26
|
-
this._value = value === VOID0
|
|
27
|
-
? new Date()
|
|
28
|
-
: new Date(value);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Returns the now local time.
|
|
33
|
-
* @returns {DateTime}
|
|
34
|
-
*/
|
|
35
|
-
static get now() {
|
|
36
|
-
return new DateTime();
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* The date component for now.
|
|
40
|
-
* @returns {DateTime}
|
|
41
|
-
*/
|
|
42
|
-
static get today() {
|
|
43
|
-
return DateTime.now.date;
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* Midnight tomorrow.
|
|
47
|
-
* @returns {DateTime}
|
|
48
|
-
*/
|
|
49
|
-
static get tomorrow() {
|
|
50
|
-
const today = DateTime.today;
|
|
51
|
-
return today.addDays(1);
|
|
52
|
-
}
|
|
53
|
-
get kind() {
|
|
54
|
-
return this._kind;
|
|
55
|
-
}
|
|
56
|
-
get year() {
|
|
57
|
-
return this._value.getFullYear();
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* Returns the Gregorian Month (zero indexed).
|
|
61
|
-
* @returns {number}
|
|
62
|
-
*/
|
|
63
|
-
get month() {
|
|
64
|
-
return this._value.getMonth();
|
|
65
|
-
}
|
|
66
|
-
/**
|
|
67
|
-
* Returns the month number (1-12).
|
|
68
|
-
* @returns {number}
|
|
69
|
-
*/
|
|
70
|
-
get calendarMonth() {
|
|
71
|
-
return this._value.getMonth() + 1;
|
|
72
|
-
}
|
|
73
|
-
get calendar() {
|
|
74
|
-
return {
|
|
75
|
-
year: this.year,
|
|
76
|
-
month: this.calendarMonth,
|
|
77
|
-
day: this.day
|
|
78
|
-
};
|
|
79
|
-
}
|
|
80
|
-
/**
|
|
81
|
-
* Returns the day of the month. An integer between 1 and 31.
|
|
82
|
-
* @returns {number}
|
|
83
|
-
*/
|
|
84
|
-
get day() {
|
|
85
|
-
return this._value.getDate();
|
|
86
|
-
}
|
|
87
|
-
/**
|
|
88
|
-
* Returns the day of the month indexed starting at zero.
|
|
89
|
-
* @returns {number}
|
|
90
|
-
*/
|
|
91
|
-
get dayIndex() {
|
|
92
|
-
return this._value.getDate() - 1;
|
|
93
|
-
}
|
|
94
|
-
/**
|
|
95
|
-
* Returns the zero indexed day of the week. (Sunday == 0)
|
|
96
|
-
* @returns {number}
|
|
97
|
-
*/
|
|
98
|
-
get dayOfWeek() {
|
|
99
|
-
return this._value.getDay();
|
|
100
|
-
}
|
|
101
|
-
/**
|
|
102
|
-
* Returns a DateTime object for 00:00 of this date.
|
|
103
|
-
*/
|
|
104
|
-
get date() {
|
|
105
|
-
const _ = this;
|
|
106
|
-
return new DateTime(new Date(_.year, _.month, _.day), _._kind);
|
|
107
|
-
}
|
|
108
|
-
/**
|
|
109
|
-
* Returns the time of day represented by a ClockTime object.
|
|
110
|
-
* @returns {ClockTime}
|
|
111
|
-
*/
|
|
112
|
-
get timeOfDay() {
|
|
113
|
-
const _ = this;
|
|
114
|
-
let t = _._time;
|
|
115
|
-
if (!t) {
|
|
116
|
-
const d = this._value;
|
|
117
|
-
_._time = t = new ClockTime_1.default(d.getHours(), d.getMinutes(), d.getSeconds(), d.getMilliseconds());
|
|
118
|
-
}
|
|
119
|
-
return t;
|
|
120
|
-
}
|
|
121
|
-
/**
|
|
122
|
-
* Measures the difference between two dates as a TimeSpan.
|
|
123
|
-
* @param first
|
|
124
|
-
* @param last
|
|
125
|
-
*/
|
|
126
|
-
static between(first, last) {
|
|
127
|
-
const f = first instanceof DateTime ? first._value : first, l = last instanceof DateTime ? last._value : last;
|
|
128
|
-
return TimeSpan_1.default.fromMilliseconds(l.getTime() - f.getTime());
|
|
129
|
-
}
|
|
130
|
-
/**
|
|
131
|
-
* Calculates if the given year is a leap year using the formula:
|
|
132
|
-
* ((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0)
|
|
133
|
-
* @param year
|
|
134
|
-
* @returns {boolean}
|
|
135
|
-
*/
|
|
136
|
-
static isLeapYear(year) {
|
|
137
|
-
return ((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0);
|
|
138
|
-
}
|
|
139
|
-
/**
|
|
140
|
-
* Returns the number of days for the specific year and month.
|
|
141
|
-
* @param year
|
|
142
|
-
* @param month
|
|
143
|
-
* @returns {any}
|
|
144
|
-
*/
|
|
145
|
-
static daysInMonth(year, month) {
|
|
146
|
-
// Basically, add 1 month, subtract a day... What's the date?
|
|
147
|
-
return (new Date(year, month + 1, 0)).getDate();
|
|
148
|
-
}
|
|
149
|
-
static from(yearOrDate, month = 0, day = 1) {
|
|
150
|
-
let year;
|
|
151
|
-
if (typeof yearOrDate == 'object') {
|
|
152
|
-
day = yearOrDate.day;
|
|
153
|
-
month = yearOrDate.month;
|
|
154
|
-
year = yearOrDate.year;
|
|
155
|
-
}
|
|
156
|
-
else {
|
|
157
|
-
year = yearOrDate;
|
|
158
|
-
}
|
|
159
|
-
return new DateTime(new Date(year, month, day));
|
|
160
|
-
}
|
|
161
|
-
static fromCalendarDate(yearOrDate, month = 1, day = 1) {
|
|
162
|
-
let year;
|
|
163
|
-
if (typeof yearOrDate == 'object') {
|
|
164
|
-
day = yearOrDate.day;
|
|
165
|
-
month = yearOrDate.month;
|
|
166
|
-
year = yearOrDate.year;
|
|
167
|
-
}
|
|
168
|
-
else {
|
|
169
|
-
year = yearOrDate;
|
|
170
|
-
}
|
|
171
|
-
return new DateTime(new Date(year, month - 1, day));
|
|
172
|
-
}
|
|
173
|
-
toJsDate() {
|
|
174
|
-
return new Date(this._value.getTime()); // return a clone.
|
|
175
|
-
}
|
|
176
|
-
addMilliseconds(ms) {
|
|
177
|
-
ms = ms || 0;
|
|
178
|
-
return new DateTime(this._value.getTime() + ms, this._kind);
|
|
179
|
-
}
|
|
180
|
-
addSeconds(seconds) {
|
|
181
|
-
seconds = seconds || 0;
|
|
182
|
-
return this.addMilliseconds(seconds * 1000 /* second */);
|
|
183
|
-
}
|
|
184
|
-
addMinutes(minutes) {
|
|
185
|
-
minutes = minutes || 0;
|
|
186
|
-
return this.addMilliseconds(minutes * 60000 /* minute */);
|
|
187
|
-
}
|
|
188
|
-
addHours(hours) {
|
|
189
|
-
hours = hours || 0;
|
|
190
|
-
return this.addMilliseconds(hours * 3600000 /* hour */);
|
|
191
|
-
}
|
|
192
|
-
addDays(days) {
|
|
193
|
-
days = days || 0;
|
|
194
|
-
return this.addMilliseconds(days * 86400000 /* day */);
|
|
195
|
-
}
|
|
196
|
-
addMonths(months) {
|
|
197
|
-
months = months || 0;
|
|
198
|
-
const d = this.toJsDate();
|
|
199
|
-
d.setMonth(d.getMonth() + months);
|
|
200
|
-
return new DateTime(d, this._kind);
|
|
201
|
-
}
|
|
202
|
-
addYears(years) {
|
|
203
|
-
years = years || 0;
|
|
204
|
-
const d = this.toJsDate();
|
|
205
|
-
d.setFullYear(d.getFullYear() + years);
|
|
206
|
-
return new DateTime(d, this._kind);
|
|
207
|
-
}
|
|
208
|
-
/**
|
|
209
|
-
* Receives an TimeQuantity value and adds based on the total milliseconds.
|
|
210
|
-
* @param {TimeQuantity} time
|
|
211
|
-
* @returns {DateTime}
|
|
212
|
-
*/
|
|
213
|
-
add(time) {
|
|
214
|
-
return this.addMilliseconds(time.getTotalMilliseconds());
|
|
215
|
-
}
|
|
216
|
-
/**
|
|
217
|
-
* Receives an TimeQuantity value and subtracts based on the total milliseconds.
|
|
218
|
-
* @param {TimeQuantity} time
|
|
219
|
-
* @returns {DateTime}
|
|
220
|
-
*/
|
|
221
|
-
subtract(time) {
|
|
222
|
-
return this.addMilliseconds(-time.getTotalMilliseconds());
|
|
223
|
-
}
|
|
224
|
-
/**
|
|
225
|
-
* Returns a TimeSpan representing the amount of time between two dates.
|
|
226
|
-
* @param previous
|
|
227
|
-
* @returns {TimeSpan}
|
|
228
|
-
*/
|
|
229
|
-
timePassedSince(previous) {
|
|
230
|
-
return DateTime.between(previous, this);
|
|
231
|
-
}
|
|
232
|
-
/**
|
|
233
|
-
* Returns a readonly object which contains all the date and time components.
|
|
234
|
-
*/
|
|
235
|
-
toTimeStamp() {
|
|
236
|
-
return TimeStamp_1.default.from(this);
|
|
237
|
-
}
|
|
238
|
-
/**
|
|
239
|
-
* Returns a UTC version of this date if its kind is local.
|
|
240
|
-
* @returns {DateTime}
|
|
241
|
-
*/
|
|
242
|
-
toUniversalTime() {
|
|
243
|
-
const _ = this;
|
|
244
|
-
if (_._kind != 1 /* Local */)
|
|
245
|
-
return new DateTime(_, _._kind);
|
|
246
|
-
const d = _._value;
|
|
247
|
-
return new DateTime(new Date(d.getUTCFullYear(), d.getUTCMonth(), d.getUTCDate(), d.getUTCHours(), d.getUTCMinutes(), d.getUTCSeconds(), d.getUTCMilliseconds()), 2 /* Utc */);
|
|
248
|
-
}
|
|
249
|
-
equals(other, strict = false) {
|
|
250
|
-
if (!other)
|
|
251
|
-
return false;
|
|
252
|
-
if (other == this)
|
|
253
|
-
return true;
|
|
254
|
-
if (other instanceof Date) {
|
|
255
|
-
const v = this._value;
|
|
256
|
-
return other == v || other.getTime() == v.getTime();
|
|
257
|
-
}
|
|
258
|
-
if (other instanceof DateTime) {
|
|
259
|
-
if (strict) {
|
|
260
|
-
const ok = other._kind;
|
|
261
|
-
if (!ok && this._kind || ok != this._kind)
|
|
262
|
-
return false;
|
|
263
|
-
}
|
|
264
|
-
return this.equals(other._value);
|
|
265
|
-
}
|
|
266
|
-
else if (strict)
|
|
267
|
-
return false;
|
|
268
|
-
return this.equals(other.toJsDate());
|
|
269
|
-
}
|
|
270
|
-
// https://msdn.microsoft.com/en-us/library/System.IComparable.CompareTo(v=vs.110).aspx
|
|
271
|
-
compareTo(other) {
|
|
272
|
-
if (!other)
|
|
273
|
-
throw new ArgumentNullException_1.default('other');
|
|
274
|
-
if (other == this)
|
|
275
|
-
return 0;
|
|
276
|
-
if (other instanceof DateTime) {
|
|
277
|
-
other = other._value;
|
|
278
|
-
}
|
|
279
|
-
const ms = this._value.getTime();
|
|
280
|
-
if (other instanceof Date) {
|
|
281
|
-
return ms - other.getTime();
|
|
282
|
-
}
|
|
283
|
-
return ms - other.toJsDate().getTime();
|
|
284
|
-
}
|
|
285
|
-
/**
|
|
286
|
-
* Returns true if the value is the same UTC time.
|
|
287
|
-
* @param {Date | JsDateConvertible} other
|
|
288
|
-
* @return {boolean}
|
|
289
|
-
*/
|
|
290
|
-
equivalent(other) {
|
|
291
|
-
if (!other)
|
|
292
|
-
return false;
|
|
293
|
-
if (other == this)
|
|
294
|
-
return true;
|
|
295
|
-
if (other instanceof Date) {
|
|
296
|
-
const v = this._value;
|
|
297
|
-
// TODO: What is the best way to handle this when kinds match or don't?
|
|
298
|
-
return v.toUTCString() == other.toUTCString();
|
|
299
|
-
}
|
|
300
|
-
if (this.equals(other, true))
|
|
301
|
-
return true;
|
|
302
|
-
return this.equivalent(other.toJsDate());
|
|
303
|
-
}
|
|
304
|
-
}
|
|
305
|
-
exports.default = DateTime;
|
|
1
|
+
"use strict";
|
|
2
|
+
/*!
|
|
3
|
+
* @author electricessence / https://github.com/electricessence/
|
|
4
|
+
* Based on .NET DateTime's interface.
|
|
5
|
+
* @license MIT
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
const tslib_1 = require("tslib");
|
|
9
|
+
const ArgumentNullException_1 = (0, tslib_1.__importDefault)(require("@tsdotnet/exceptions/dist/ArgumentNullException"));
|
|
10
|
+
const ClockTime_1 = (0, tslib_1.__importDefault)(require("./ClockTime"));
|
|
11
|
+
const TimeSpan_1 = (0, tslib_1.__importDefault)(require("./TimeSpan"));
|
|
12
|
+
const TimeStamp_1 = (0, tslib_1.__importDefault)(require("./TimeStamp"));
|
|
13
|
+
const VOID0 = void 0;
|
|
14
|
+
class DateTime {
|
|
15
|
+
constructor(value = new Date(), kind = 1 /* Local */) {
|
|
16
|
+
this._kind = kind;
|
|
17
|
+
if (value instanceof DateTime) {
|
|
18
|
+
this._value = value.toJsDate();
|
|
19
|
+
if (kind === VOID0)
|
|
20
|
+
this._kind = value._kind;
|
|
21
|
+
}
|
|
22
|
+
else { // noinspection SuspiciousInstanceOfGuard
|
|
23
|
+
if (value instanceof Date)
|
|
24
|
+
this._value = new Date(value.getTime());
|
|
25
|
+
else
|
|
26
|
+
this._value = value === VOID0
|
|
27
|
+
? new Date()
|
|
28
|
+
: new Date(value);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Returns the now local time.
|
|
33
|
+
* @returns {DateTime}
|
|
34
|
+
*/
|
|
35
|
+
static get now() {
|
|
36
|
+
return new DateTime();
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* The date component for now.
|
|
40
|
+
* @returns {DateTime}
|
|
41
|
+
*/
|
|
42
|
+
static get today() {
|
|
43
|
+
return DateTime.now.date;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Midnight tomorrow.
|
|
47
|
+
* @returns {DateTime}
|
|
48
|
+
*/
|
|
49
|
+
static get tomorrow() {
|
|
50
|
+
const today = DateTime.today;
|
|
51
|
+
return today.addDays(1);
|
|
52
|
+
}
|
|
53
|
+
get kind() {
|
|
54
|
+
return this._kind;
|
|
55
|
+
}
|
|
56
|
+
get year() {
|
|
57
|
+
return this._value.getFullYear();
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Returns the Gregorian Month (zero indexed).
|
|
61
|
+
* @returns {number}
|
|
62
|
+
*/
|
|
63
|
+
get month() {
|
|
64
|
+
return this._value.getMonth();
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Returns the month number (1-12).
|
|
68
|
+
* @returns {number}
|
|
69
|
+
*/
|
|
70
|
+
get calendarMonth() {
|
|
71
|
+
return this._value.getMonth() + 1;
|
|
72
|
+
}
|
|
73
|
+
get calendar() {
|
|
74
|
+
return {
|
|
75
|
+
year: this.year,
|
|
76
|
+
month: this.calendarMonth,
|
|
77
|
+
day: this.day
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Returns the day of the month. An integer between 1 and 31.
|
|
82
|
+
* @returns {number}
|
|
83
|
+
*/
|
|
84
|
+
get day() {
|
|
85
|
+
return this._value.getDate();
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Returns the day of the month indexed starting at zero.
|
|
89
|
+
* @returns {number}
|
|
90
|
+
*/
|
|
91
|
+
get dayIndex() {
|
|
92
|
+
return this._value.getDate() - 1;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Returns the zero indexed day of the week. (Sunday == 0)
|
|
96
|
+
* @returns {number}
|
|
97
|
+
*/
|
|
98
|
+
get dayOfWeek() {
|
|
99
|
+
return this._value.getDay();
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Returns a DateTime object for 00:00 of this date.
|
|
103
|
+
*/
|
|
104
|
+
get date() {
|
|
105
|
+
const _ = this;
|
|
106
|
+
return new DateTime(new Date(_.year, _.month, _.day), _._kind);
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Returns the time of day represented by a ClockTime object.
|
|
110
|
+
* @returns {ClockTime}
|
|
111
|
+
*/
|
|
112
|
+
get timeOfDay() {
|
|
113
|
+
const _ = this;
|
|
114
|
+
let t = _._time;
|
|
115
|
+
if (!t) {
|
|
116
|
+
const d = this._value;
|
|
117
|
+
_._time = t = new ClockTime_1.default(d.getHours(), d.getMinutes(), d.getSeconds(), d.getMilliseconds());
|
|
118
|
+
}
|
|
119
|
+
return t;
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Measures the difference between two dates as a TimeSpan.
|
|
123
|
+
* @param first
|
|
124
|
+
* @param last
|
|
125
|
+
*/
|
|
126
|
+
static between(first, last) {
|
|
127
|
+
const f = first instanceof DateTime ? first._value : first, l = last instanceof DateTime ? last._value : last;
|
|
128
|
+
return TimeSpan_1.default.fromMilliseconds(l.getTime() - f.getTime());
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Calculates if the given year is a leap year using the formula:
|
|
132
|
+
* ((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0)
|
|
133
|
+
* @param year
|
|
134
|
+
* @returns {boolean}
|
|
135
|
+
*/
|
|
136
|
+
static isLeapYear(year) {
|
|
137
|
+
return ((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0);
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Returns the number of days for the specific year and month.
|
|
141
|
+
* @param year
|
|
142
|
+
* @param month
|
|
143
|
+
* @returns {any}
|
|
144
|
+
*/
|
|
145
|
+
static daysInMonth(year, month) {
|
|
146
|
+
// Basically, add 1 month, subtract a day... What's the date?
|
|
147
|
+
return (new Date(year, month + 1, 0)).getDate();
|
|
148
|
+
}
|
|
149
|
+
static from(yearOrDate, month = 0, day = 1) {
|
|
150
|
+
let year;
|
|
151
|
+
if (typeof yearOrDate == 'object') {
|
|
152
|
+
day = yearOrDate.day;
|
|
153
|
+
month = yearOrDate.month;
|
|
154
|
+
year = yearOrDate.year;
|
|
155
|
+
}
|
|
156
|
+
else {
|
|
157
|
+
year = yearOrDate;
|
|
158
|
+
}
|
|
159
|
+
return new DateTime(new Date(year, month, day));
|
|
160
|
+
}
|
|
161
|
+
static fromCalendarDate(yearOrDate, month = 1, day = 1) {
|
|
162
|
+
let year;
|
|
163
|
+
if (typeof yearOrDate == 'object') {
|
|
164
|
+
day = yearOrDate.day;
|
|
165
|
+
month = yearOrDate.month;
|
|
166
|
+
year = yearOrDate.year;
|
|
167
|
+
}
|
|
168
|
+
else {
|
|
169
|
+
year = yearOrDate;
|
|
170
|
+
}
|
|
171
|
+
return new DateTime(new Date(year, month - 1, day));
|
|
172
|
+
}
|
|
173
|
+
toJsDate() {
|
|
174
|
+
return new Date(this._value.getTime()); // return a clone.
|
|
175
|
+
}
|
|
176
|
+
addMilliseconds(ms) {
|
|
177
|
+
ms = ms || 0;
|
|
178
|
+
return new DateTime(this._value.getTime() + ms, this._kind);
|
|
179
|
+
}
|
|
180
|
+
addSeconds(seconds) {
|
|
181
|
+
seconds = seconds || 0;
|
|
182
|
+
return this.addMilliseconds(seconds * 1000 /* second */);
|
|
183
|
+
}
|
|
184
|
+
addMinutes(minutes) {
|
|
185
|
+
minutes = minutes || 0;
|
|
186
|
+
return this.addMilliseconds(minutes * 60000 /* minute */);
|
|
187
|
+
}
|
|
188
|
+
addHours(hours) {
|
|
189
|
+
hours = hours || 0;
|
|
190
|
+
return this.addMilliseconds(hours * 3600000 /* hour */);
|
|
191
|
+
}
|
|
192
|
+
addDays(days) {
|
|
193
|
+
days = days || 0;
|
|
194
|
+
return this.addMilliseconds(days * 86400000 /* day */);
|
|
195
|
+
}
|
|
196
|
+
addMonths(months) {
|
|
197
|
+
months = months || 0;
|
|
198
|
+
const d = this.toJsDate();
|
|
199
|
+
d.setMonth(d.getMonth() + months);
|
|
200
|
+
return new DateTime(d, this._kind);
|
|
201
|
+
}
|
|
202
|
+
addYears(years) {
|
|
203
|
+
years = years || 0;
|
|
204
|
+
const d = this.toJsDate();
|
|
205
|
+
d.setFullYear(d.getFullYear() + years);
|
|
206
|
+
return new DateTime(d, this._kind);
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* Receives an TimeQuantity value and adds based on the total milliseconds.
|
|
210
|
+
* @param {TimeQuantity} time
|
|
211
|
+
* @returns {DateTime}
|
|
212
|
+
*/
|
|
213
|
+
add(time) {
|
|
214
|
+
return this.addMilliseconds(time.getTotalMilliseconds());
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* Receives an TimeQuantity value and subtracts based on the total milliseconds.
|
|
218
|
+
* @param {TimeQuantity} time
|
|
219
|
+
* @returns {DateTime}
|
|
220
|
+
*/
|
|
221
|
+
subtract(time) {
|
|
222
|
+
return this.addMilliseconds(-time.getTotalMilliseconds());
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* Returns a TimeSpan representing the amount of time between two dates.
|
|
226
|
+
* @param previous
|
|
227
|
+
* @returns {TimeSpan}
|
|
228
|
+
*/
|
|
229
|
+
timePassedSince(previous) {
|
|
230
|
+
return DateTime.between(previous, this);
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* Returns a readonly object which contains all the date and time components.
|
|
234
|
+
*/
|
|
235
|
+
toTimeStamp() {
|
|
236
|
+
return TimeStamp_1.default.from(this);
|
|
237
|
+
}
|
|
238
|
+
/**
|
|
239
|
+
* Returns a UTC version of this date if its kind is local.
|
|
240
|
+
* @returns {DateTime}
|
|
241
|
+
*/
|
|
242
|
+
toUniversalTime() {
|
|
243
|
+
const _ = this;
|
|
244
|
+
if (_._kind != 1 /* Local */)
|
|
245
|
+
return new DateTime(_, _._kind);
|
|
246
|
+
const d = _._value;
|
|
247
|
+
return new DateTime(new Date(d.getUTCFullYear(), d.getUTCMonth(), d.getUTCDate(), d.getUTCHours(), d.getUTCMinutes(), d.getUTCSeconds(), d.getUTCMilliseconds()), 2 /* Utc */);
|
|
248
|
+
}
|
|
249
|
+
equals(other, strict = false) {
|
|
250
|
+
if (!other)
|
|
251
|
+
return false;
|
|
252
|
+
if (other == this)
|
|
253
|
+
return true;
|
|
254
|
+
if (other instanceof Date) {
|
|
255
|
+
const v = this._value;
|
|
256
|
+
return other == v || other.getTime() == v.getTime();
|
|
257
|
+
}
|
|
258
|
+
if (other instanceof DateTime) {
|
|
259
|
+
if (strict) {
|
|
260
|
+
const ok = other._kind;
|
|
261
|
+
if (!ok && this._kind || ok != this._kind)
|
|
262
|
+
return false;
|
|
263
|
+
}
|
|
264
|
+
return this.equals(other._value);
|
|
265
|
+
}
|
|
266
|
+
else if (strict)
|
|
267
|
+
return false;
|
|
268
|
+
return this.equals(other.toJsDate());
|
|
269
|
+
}
|
|
270
|
+
// https://msdn.microsoft.com/en-us/library/System.IComparable.CompareTo(v=vs.110).aspx
|
|
271
|
+
compareTo(other) {
|
|
272
|
+
if (!other)
|
|
273
|
+
throw new ArgumentNullException_1.default('other');
|
|
274
|
+
if (other == this)
|
|
275
|
+
return 0;
|
|
276
|
+
if (other instanceof DateTime) {
|
|
277
|
+
other = other._value;
|
|
278
|
+
}
|
|
279
|
+
const ms = this._value.getTime();
|
|
280
|
+
if (other instanceof Date) {
|
|
281
|
+
return ms - other.getTime();
|
|
282
|
+
}
|
|
283
|
+
return ms - other.toJsDate().getTime();
|
|
284
|
+
}
|
|
285
|
+
/**
|
|
286
|
+
* Returns true if the value is the same UTC time.
|
|
287
|
+
* @param {Date | JsDateConvertible} other
|
|
288
|
+
* @return {boolean}
|
|
289
|
+
*/
|
|
290
|
+
equivalent(other) {
|
|
291
|
+
if (!other)
|
|
292
|
+
return false;
|
|
293
|
+
if (other == this)
|
|
294
|
+
return true;
|
|
295
|
+
if (other instanceof Date) {
|
|
296
|
+
const v = this._value;
|
|
297
|
+
// TODO: What is the best way to handle this when kinds match or don't?
|
|
298
|
+
return v.toUTCString() == other.toUTCString();
|
|
299
|
+
}
|
|
300
|
+
if (this.equals(other, true))
|
|
301
|
+
return true;
|
|
302
|
+
return this.equivalent(other.toJsDate());
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
exports.default = DateTime;
|
|
306
306
|
//# sourceMappingURL=DateTime.js.map
|
package/dist/DateTime.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateTime.js","sourceRoot":"","sources":["../src/DateTime.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,
|
|
1
|
+
{"version":3,"file":"DateTime.js","sourceRoot":"","sources":["../src/DateTime.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,yHAAoF;AAGpF,yEAAoC;AAKpC,uEAAkC;AAClC,yEAAoC;AAEpC,MAAM,KAAK,GAAc,KAAK,CAAC,CAAC;AAEhC,MAAqB,QAAQ;IAiB5B,YAAa,QAAa,IAAI,IAAI,EAAE,EAAE,oBAAuC;QAE5E,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAClB,IAAG,KAAK,YAAY,QAAQ,EAC5B;YACC,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC,QAAQ,EAAE,CAAC;YAC/B,IAAG,IAAI,KAAG,KAAK;gBAAE,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC;SAC1C;aAED,EAAE,yCAAyC;YAC1C,IAAG,KAAK,YAAY,IAAI;gBACvB,IAAI,CAAC,MAAM,GAAG,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;;gBAExC,IAAI,CAAC,MAAM,GAAG,KAAK,KAAG,KAAK;oBAC1B,CAAC,CAAC,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