@tsdotnet/date-time 1.0.33 → 1.1.1
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/{ClockTime.js → cjs/ClockTime.js} +64 -67
- package/dist/cjs/ClockTime.js.map +1 -0
- package/dist/{DateTime.js → cjs/DateTime.js} +219 -305
- package/dist/cjs/DateTime.js.map +1 -0
- package/dist/cjs/DateTimeKind.js +7 -0
- package/dist/cjs/DateTimeKind.js.map +1 -0
- package/dist/cjs/TimeQuantity.js +63 -0
- package/dist/cjs/TimeQuantity.js.map +1 -0
- package/dist/{TimeSpan.js → cjs/TimeSpan.js} +87 -111
- package/dist/cjs/TimeSpan.js.map +1 -0
- package/dist/{TimeStamp.js → cjs/TimeStamp.js} +41 -45
- package/dist/cjs/TimeStamp.js.map +1 -0
- package/dist/{TimeUnit.js → cjs/TimeUnit.js} +71 -99
- package/dist/cjs/TimeUnit.js.map +1 -0
- package/dist/{TimeUnitValue.js → cjs/TimeUnitValue.js} +42 -46
- package/dist/cjs/TimeUnitValue.js.map +1 -0
- package/dist/{date-time.js → cjs/date-time.js} +24 -28
- package/dist/cjs/date-time.js.map +1 -0
- package/dist/cjs/howMany.js +7 -0
- package/dist/cjs/howMany.js.map +1 -0
- package/{dist-esm → dist/esm}/ClockTime.js +68 -63
- package/dist/esm/ClockTime.js.map +1 -0
- package/{dist-esm → dist/esm}/DateTime.js +222 -302
- package/dist/esm/DateTime.js.map +1 -0
- package/dist/esm/TimeQuantity.js +64 -0
- package/dist/esm/TimeQuantity.js.map +1 -0
- package/{dist-esm → dist/esm}/TimeSpan.js +92 -107
- package/dist/esm/TimeSpan.js.map +1 -0
- package/{dist-esm → dist/esm}/TimeStamp.js +47 -41
- package/dist/esm/TimeStamp.js.map +1 -0
- package/{dist-esm → dist/esm}/TimeUnit.js +71 -97
- package/dist/esm/TimeUnit.js.map +1 -0
- package/{dist-esm → dist/esm}/TimeUnitValue.js +43 -43
- package/dist/esm/TimeUnitValue.js.map +1 -0
- package/dist/esm/date-time.js +10 -0
- package/dist/esm/date-time.js.map +1 -0
- package/dist/esm/howMany.js +5 -0
- package/dist/esm/howMany.js.map +1 -0
- package/dist/{CalendarDate.d.ts → types/CalendarDate.d.ts} +1 -0
- package/dist/{ClockTime.d.ts → types/ClockTime.d.ts} +20 -20
- package/dist/{ClockTimeValue.d.ts → types/ClockTimeValue.d.ts} +1 -0
- package/dist/types/DateTime.d.ts +60 -0
- package/dist/{DateTimeKind.d.ts → types/DateTimeKind.d.ts} +10 -15
- package/dist/{JsDateConvertible.d.ts → types/JsDateConvertible.d.ts} +1 -0
- package/dist/{TimeMeasurement.d.ts → types/TimeMeasurement.d.ts} +1 -0
- package/dist/types/TimeQuantity.d.ts +19 -0
- package/dist/{TimeSpan.d.ts → types/TimeSpan.d.ts} +33 -73
- package/dist/{TimeStamp.d.ts → types/TimeStamp.d.ts} +22 -25
- package/dist/{TimeStampValue.d.ts → types/TimeStampValue.d.ts} +1 -0
- package/dist/types/TimeUnit.d.ts +21 -0
- package/dist/{TimeUnitValue.d.ts → types/TimeUnitValue.d.ts} +16 -19
- package/{dist-esm/date-time.js → dist/types/date-time.d.ts} +21 -16
- package/dist/{howMany.d.ts → types/howMany.d.ts} +39 -39
- package/eslint.config.mjs +25 -0
- package/package.json +48 -42
- package/rollup.config.js +37 -0
- package/dist/ClockTime.js.map +0 -1
- package/dist/DateTime.d.ts +0 -154
- package/dist/DateTime.js.map +0 -1
- package/dist/TimeQuantity.d.ts +0 -50
- package/dist/TimeQuantity.js +0 -96
- package/dist/TimeQuantity.js.map +0 -1
- package/dist/TimeSpan.js.map +0 -1
- package/dist/TimeStamp.js.map +0 -1
- package/dist/TimeUnit.d.ts +0 -47
- package/dist/TimeUnit.js.map +0 -1
- package/dist/TimeUnitValue.js.map +0 -1
- package/dist/date-time.d.ts +0 -20
- package/dist/date-time.js.map +0 -1
- package/dist/howMany.js +0 -53
- package/dist/howMany.js.map +0 -1
- package/dist-esm/ClockTime.js.map +0 -1
- package/dist-esm/DateTime.js.map +0 -1
- package/dist-esm/TimeQuantity.js +0 -92
- package/dist-esm/TimeQuantity.js.map +0 -1
- package/dist-esm/TimeSpan.js.map +0 -1
- package/dist-esm/TimeStamp.js.map +0 -1
- package/dist-esm/TimeUnit.js.map +0 -1
- package/dist-esm/TimeUnitValue.js.map +0 -1
- package/dist-esm/date-time.js.map +0 -1
- package/dist-esm/howMany.js +0 -50
- package/dist-esm/howMany.js.map +0 -1
- /package/dist/{Calendars → types/Calendars}/Gregorian.d.ts +0 -0
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* @author electricessence / https://github.com/electricessence/
|
|
3
|
-
* @license MIT
|
|
4
|
-
*/
|
|
5
|
-
import ClockTimeValue from './ClockTimeValue';
|
|
6
|
-
import TimeQuantity from './TimeQuantity';
|
|
7
|
-
export declare class ClockTime extends TimeQuantity implements Required<ClockTimeValue> {
|
|
8
|
-
readonly day: number;
|
|
9
|
-
readonly hour: number;
|
|
10
|
-
readonly minute: number;
|
|
11
|
-
readonly second: number;
|
|
12
|
-
readonly millisecond: number;
|
|
13
|
-
readonly tick: number;
|
|
14
|
-
constructor(milliseconds: number);
|
|
15
|
-
constructor(hours: number, minutes: number, seconds?: number, milliseconds?: number);
|
|
16
|
-
static from(hours: number, minutes: number, seconds?: number, milliseconds?: number): ClockTime;
|
|
17
|
-
static millisecondsFromTime(hours: number, minutes: number, seconds?: number, milliseconds?: number): number;
|
|
18
|
-
toString(): string;
|
|
19
|
-
}
|
|
20
|
-
export default ClockTime;
|
|
1
|
+
/*!
|
|
2
|
+
* @author electricessence / https://github.com/electricessence/
|
|
3
|
+
* @license MIT
|
|
4
|
+
*/
|
|
5
|
+
import type ClockTimeValue from './ClockTimeValue';
|
|
6
|
+
import TimeQuantity from './TimeQuantity';
|
|
7
|
+
export declare class ClockTime extends TimeQuantity implements Required<ClockTimeValue> {
|
|
8
|
+
readonly day: number;
|
|
9
|
+
readonly hour: number;
|
|
10
|
+
readonly minute: number;
|
|
11
|
+
readonly second: number;
|
|
12
|
+
readonly millisecond: number;
|
|
13
|
+
readonly tick: number;
|
|
14
|
+
constructor(milliseconds: number);
|
|
15
|
+
constructor(hours: number, minutes: number, seconds?: number, milliseconds?: number);
|
|
16
|
+
static from(hours: number, minutes: number, seconds?: number, milliseconds?: number): ClockTime;
|
|
17
|
+
static millisecondsFromTime(hours: number, minutes: number, seconds?: number, milliseconds?: number): number;
|
|
18
|
+
toString(): string;
|
|
19
|
+
}
|
|
20
|
+
export default ClockTime;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* @author electricessence / https://github.com/electricessence/
|
|
3
|
+
* Based on .NET DateTime's interface.
|
|
4
|
+
* @license MIT
|
|
5
|
+
*/
|
|
6
|
+
import CalendarDate from './CalendarDate';
|
|
7
|
+
import Gregorian from './Calendars/Gregorian';
|
|
8
|
+
import ClockTime from './ClockTime';
|
|
9
|
+
import DateTimeKind from './DateTimeKind';
|
|
10
|
+
import type JsDateConvertible from './JsDateConvertible';
|
|
11
|
+
import TimeQuantity from './TimeQuantity';
|
|
12
|
+
import TimeSpan from './TimeSpan';
|
|
13
|
+
import TimeStamp from './TimeStamp';
|
|
14
|
+
export default class DateTime implements CalendarDate, JsDateConvertible {
|
|
15
|
+
private readonly _value;
|
|
16
|
+
private readonly _kind;
|
|
17
|
+
private _time;
|
|
18
|
+
constructor();
|
|
19
|
+
constructor(dateString: string, kind?: DateTimeKind);
|
|
20
|
+
constructor(milliseconds: number, kind?: DateTimeKind);
|
|
21
|
+
constructor(source: Date, kind?: DateTimeKind);
|
|
22
|
+
constructor(source: DateTime, kind?: DateTimeKind);
|
|
23
|
+
static get now(): DateTime;
|
|
24
|
+
static get today(): DateTime;
|
|
25
|
+
static get tomorrow(): DateTime;
|
|
26
|
+
get kind(): DateTimeKind;
|
|
27
|
+
get year(): number;
|
|
28
|
+
get month(): Gregorian.Month;
|
|
29
|
+
get calendarMonth(): number;
|
|
30
|
+
get calendar(): CalendarDate;
|
|
31
|
+
get day(): number;
|
|
32
|
+
get dayIndex(): number;
|
|
33
|
+
get dayOfWeek(): Gregorian.DayOfWeek;
|
|
34
|
+
get date(): DateTime;
|
|
35
|
+
get timeOfDay(): ClockTime;
|
|
36
|
+
static between(first: Date | DateTime, last: Date | DateTime): TimeSpan;
|
|
37
|
+
static isLeapYear(year: number): boolean;
|
|
38
|
+
static daysInMonth(year: number, month: Gregorian.Month): number;
|
|
39
|
+
static from(calendarDate: CalendarDate): DateTime;
|
|
40
|
+
static from(year: number, month: Gregorian.Month, day: number): DateTime;
|
|
41
|
+
static fromCalendarDate(calendarDate: CalendarDate): DateTime;
|
|
42
|
+
static fromCalendarDate(year: number, month: number, day: number): DateTime;
|
|
43
|
+
toJsDate(): Date;
|
|
44
|
+
addMilliseconds(ms: number): DateTime;
|
|
45
|
+
addSeconds(seconds: number): DateTime;
|
|
46
|
+
addMinutes(minutes: number): DateTime;
|
|
47
|
+
addHours(hours: number): DateTime;
|
|
48
|
+
addDays(days: number): DateTime;
|
|
49
|
+
addMonths(months: number): DateTime;
|
|
50
|
+
addYears(years: number): DateTime;
|
|
51
|
+
add(time: TimeQuantity): DateTime;
|
|
52
|
+
subtract(time: TimeQuantity): DateTime;
|
|
53
|
+
timePassedSince(previous: Date | DateTime): TimeSpan;
|
|
54
|
+
toTimeStamp(): TimeStamp;
|
|
55
|
+
toUniversalTime(): DateTime;
|
|
56
|
+
equals(other: Date): boolean;
|
|
57
|
+
equals(other: JsDateConvertible, strict?: boolean): boolean;
|
|
58
|
+
compareTo(other: Date | JsDateConvertible): number;
|
|
59
|
+
equivalent(other: Date | JsDateConvertible): boolean;
|
|
60
|
+
}
|
|
@@ -1,15 +1,10 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* @author electricessence / https://github.com/electricessence/
|
|
3
|
-
* @license MIT
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
Local,
|
|
12
|
-
Utc,
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export default DateTimeKind;
|
|
1
|
+
/*!
|
|
2
|
+
* @author electricessence / https://github.com/electricessence/
|
|
3
|
+
* @license MIT
|
|
4
|
+
*/
|
|
5
|
+
declare const enum DateTimeKind {
|
|
6
|
+
Unspecified = 0,
|
|
7
|
+
Local = 1,
|
|
8
|
+
Utc = 2
|
|
9
|
+
}
|
|
10
|
+
export default DateTimeKind;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* @author electricessence / https://github.com/electricessence/
|
|
3
|
+
* @license MIT
|
|
4
|
+
*/
|
|
5
|
+
import { ResettableLazy } from '@tsdotnet/lazy';
|
|
6
|
+
import type TimeMeasurement from './TimeMeasurement';
|
|
7
|
+
import TimeUnit from './TimeUnit';
|
|
8
|
+
export default class TimeQuantity {
|
|
9
|
+
protected _quantity: number;
|
|
10
|
+
constructor(_quantity?: number);
|
|
11
|
+
static getTotalMillisecondsFrom(values: Partial<TimeMeasurement>): number;
|
|
12
|
+
get direction(): number;
|
|
13
|
+
protected _total: ResettableLazy<Readonly<TimeMeasurement>>;
|
|
14
|
+
get total(): Readonly<TimeMeasurement>;
|
|
15
|
+
getTotalMilliseconds(): number;
|
|
16
|
+
equals(other: TimeQuantity): boolean;
|
|
17
|
+
compareTo(other: TimeQuantity): number;
|
|
18
|
+
getTotal(units: TimeUnit.UnitType): number;
|
|
19
|
+
}
|
|
@@ -1,73 +1,33 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* @author electricessence / https://github.com/electricessence/
|
|
3
|
-
* Originally based upon .NET source but with many additions and improvements.
|
|
4
|
-
* @license MIT
|
|
5
|
-
*/
|
|
6
|
-
import ClockTime from './ClockTime';
|
|
7
|
-
import TimeMeasurement from './TimeMeasurement';
|
|
8
|
-
import TimeQuantity from './TimeQuantity';
|
|
9
|
-
import TimeUnit from './TimeUnit';
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* The total number of ticks that days this amount of time.
|
|
36
|
-
*/
|
|
37
|
-
readonly days: number;
|
|
38
|
-
protected constructor(value: number, units?: TimeUnit.UnitType);
|
|
39
|
-
static get zero(): TimeSpan;
|
|
40
|
-
/**
|
|
41
|
-
* Provides an standard interface for acquiring the total time.
|
|
42
|
-
* @returns {TimeSpan}
|
|
43
|
-
*/
|
|
44
|
-
get total(): TimeSpan;
|
|
45
|
-
private _time;
|
|
46
|
-
/**
|
|
47
|
-
* The value of this TimeSpan reduced to the clock and calendar.
|
|
48
|
-
* @return {ClockTime}
|
|
49
|
-
*/
|
|
50
|
-
get time(): ClockTime;
|
|
51
|
-
static from(values: Partial<TimeMeasurement>): TimeSpan;
|
|
52
|
-
static from(value: number, units: TimeUnit.UnitType): TimeSpan;
|
|
53
|
-
static fromDays(value: number): TimeSpan;
|
|
54
|
-
static fromHours(value: number): TimeSpan;
|
|
55
|
-
static fromMinutes(value: number): TimeSpan;
|
|
56
|
-
static fromSeconds(value: number): TimeSpan;
|
|
57
|
-
static fromMilliseconds(value: number): TimeSpan;
|
|
58
|
-
static fromTicks(value: number): TimeSpan;
|
|
59
|
-
/**
|
|
60
|
-
* Sum the value of this TimeSpan with another time quantity.
|
|
61
|
-
* @param {TimeQuantity | Partial<TimeMeasurement>} other
|
|
62
|
-
* @return {TimeSpan}
|
|
63
|
-
*/
|
|
64
|
-
add(other: TimeSpan | TimeQuantity | Partial<TimeMeasurement>): TimeSpan;
|
|
65
|
-
/**
|
|
66
|
-
* Sum the value of this TimeSpan with another unit value.
|
|
67
|
-
* @param {number} value
|
|
68
|
-
* @param {TimeUnit.UnitType} units
|
|
69
|
-
* @return {TimeSpan}
|
|
70
|
-
*/
|
|
71
|
-
addUnit(value: number, units?: TimeUnit.UnitType): TimeSpan;
|
|
72
|
-
}
|
|
73
|
-
export default TimeSpan;
|
|
1
|
+
/*!
|
|
2
|
+
* @author electricessence / https://github.com/electricessence/
|
|
3
|
+
* Originally based upon .NET source but with many additions and improvements.
|
|
4
|
+
* @license MIT
|
|
5
|
+
*/
|
|
6
|
+
import ClockTime from './ClockTime';
|
|
7
|
+
import TimeMeasurement from './TimeMeasurement';
|
|
8
|
+
import TimeQuantity from './TimeQuantity';
|
|
9
|
+
import TimeUnit from './TimeUnit';
|
|
10
|
+
export declare class TimeSpan extends TimeQuantity implements TimeMeasurement {
|
|
11
|
+
readonly ticks: number;
|
|
12
|
+
readonly milliseconds: number;
|
|
13
|
+
readonly seconds: number;
|
|
14
|
+
readonly minutes: number;
|
|
15
|
+
readonly hours: number;
|
|
16
|
+
readonly days: number;
|
|
17
|
+
protected constructor(value: number, units?: TimeUnit.UnitType);
|
|
18
|
+
static get zero(): TimeSpan;
|
|
19
|
+
get total(): TimeSpan;
|
|
20
|
+
private _time;
|
|
21
|
+
get time(): ClockTime;
|
|
22
|
+
static from(values: Partial<TimeMeasurement>): TimeSpan;
|
|
23
|
+
static from(value: number, units: TimeUnit.UnitType): TimeSpan;
|
|
24
|
+
static fromDays(value: number): TimeSpan;
|
|
25
|
+
static fromHours(value: number): TimeSpan;
|
|
26
|
+
static fromMinutes(value: number): TimeSpan;
|
|
27
|
+
static fromSeconds(value: number): TimeSpan;
|
|
28
|
+
static fromMilliseconds(value: number): TimeSpan;
|
|
29
|
+
static fromTicks(value: number): TimeSpan;
|
|
30
|
+
add(other: TimeSpan | TimeQuantity | Partial<TimeMeasurement>): TimeSpan;
|
|
31
|
+
addUnit(value: number, units?: TimeUnit.UnitType): TimeSpan;
|
|
32
|
+
}
|
|
33
|
+
export default TimeSpan;
|
|
@@ -1,25 +1,22 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* @author electricessence / https://github.com/electricessence/
|
|
3
|
-
* @license MIT
|
|
4
|
-
*/
|
|
5
|
-
import Gregorian from './Calendars/Gregorian';
|
|
6
|
-
import JsDateConvertible from './JsDateConvertible';
|
|
7
|
-
import TimeStampValue from './TimeStampValue';
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
readonly
|
|
13
|
-
readonly
|
|
14
|
-
readonly
|
|
15
|
-
readonly
|
|
16
|
-
readonly
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
toJsDate(): Date;
|
|
24
|
-
}
|
|
25
|
-
export default TimeStamp;
|
|
1
|
+
/*!
|
|
2
|
+
* @author electricessence / https://github.com/electricessence/
|
|
3
|
+
* @license MIT
|
|
4
|
+
*/
|
|
5
|
+
import Gregorian from './Calendars/Gregorian';
|
|
6
|
+
import JsDateConvertible from './JsDateConvertible';
|
|
7
|
+
import TimeStampValue from './TimeStampValue';
|
|
8
|
+
export declare class TimeStamp implements Required<TimeStampValue>, JsDateConvertible {
|
|
9
|
+
readonly year: number;
|
|
10
|
+
readonly month: Gregorian.Month;
|
|
11
|
+
readonly day: number;
|
|
12
|
+
readonly hour: number;
|
|
13
|
+
readonly minute: number;
|
|
14
|
+
readonly second: number;
|
|
15
|
+
readonly millisecond: number;
|
|
16
|
+
readonly tick: number;
|
|
17
|
+
constructor(year: number, month: Gregorian.Month, day?: number, hour?: number, minute?: number, second?: number, millisecond?: number, tick?: number);
|
|
18
|
+
static from(d: Date | JsDateConvertible): TimeStamp;
|
|
19
|
+
static now(): TimeStamp;
|
|
20
|
+
toJsDate(): Date;
|
|
21
|
+
}
|
|
22
|
+
export default TimeStamp;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* @author electricessence / https://github.com/electricessence/
|
|
3
|
+
* Originally based upon .NET source but with many additions and improvements.
|
|
4
|
+
* @license MIT
|
|
5
|
+
*/
|
|
6
|
+
import TimeQuantity from './TimeQuantity';
|
|
7
|
+
export declare namespace TimeUnit {
|
|
8
|
+
enum UnitType {
|
|
9
|
+
Ticks = 0,
|
|
10
|
+
Milliseconds = 1,
|
|
11
|
+
Seconds = 2,
|
|
12
|
+
Minutes = 3,
|
|
13
|
+
Hours = 4,
|
|
14
|
+
Days = 5
|
|
15
|
+
}
|
|
16
|
+
function toMilliseconds(value: number, units: UnitType): number;
|
|
17
|
+
function fromMilliseconds(ms: number, units: UnitType): number;
|
|
18
|
+
function from(quantity: TimeQuantity, toUnits: UnitType): number;
|
|
19
|
+
function assertValid(unit: UnitType): true | never;
|
|
20
|
+
}
|
|
21
|
+
export default TimeUnit;
|
|
@@ -1,19 +1,16 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* @author electricessence / https://github.com/electricessence/
|
|
3
|
-
* @license MIT
|
|
4
|
-
*/
|
|
5
|
-
import TimeQuantity from './TimeQuantity';
|
|
6
|
-
import TimeUnit from './TimeUnit';
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
getTotalMilliseconds(): number;
|
|
18
|
-
to(units?: TimeUnit.UnitType): TimeUnitValue;
|
|
19
|
-
}
|
|
1
|
+
/*!
|
|
2
|
+
* @author electricessence / https://github.com/electricessence/
|
|
3
|
+
* @license MIT
|
|
4
|
+
*/
|
|
5
|
+
import TimeQuantity from './TimeQuantity';
|
|
6
|
+
import TimeUnit from './TimeUnit';
|
|
7
|
+
export default class TimeUnitValue extends TimeQuantity {
|
|
8
|
+
private _units;
|
|
9
|
+
constructor(value: number | TimeQuantity, _units: TimeUnit.UnitType);
|
|
10
|
+
get value(): number;
|
|
11
|
+
set value(v: number);
|
|
12
|
+
get units(): TimeUnit.UnitType;
|
|
13
|
+
static from(value: number | TimeQuantity, units?: TimeUnit.UnitType): TimeUnitValue;
|
|
14
|
+
getTotalMilliseconds(): number;
|
|
15
|
+
to(units?: TimeUnit.UnitType): TimeUnitValue;
|
|
16
|
+
}
|
|
@@ -1,16 +1,21 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* @author electricessence / https://github.com/electricessence/
|
|
3
|
-
* @license MIT
|
|
4
|
-
*/
|
|
5
|
-
import Gregorian from './Calendars/Gregorian';
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
|
|
16
|
-
|
|
1
|
+
/*!
|
|
2
|
+
* @author electricessence / https://github.com/electricessence/
|
|
3
|
+
* @license MIT
|
|
4
|
+
*/
|
|
5
|
+
import Gregorian from './Calendars/Gregorian';
|
|
6
|
+
import type CalendarDate from './CalendarDate';
|
|
7
|
+
import ClockTime from './ClockTime';
|
|
8
|
+
import type ClockTimeValue from './ClockTimeValue';
|
|
9
|
+
import DateTime from './DateTime';
|
|
10
|
+
import DateTimeKind from './DateTimeKind';
|
|
11
|
+
import * as howMany from './howMany';
|
|
12
|
+
import type TimeMeasurement from './TimeMeasurement';
|
|
13
|
+
import TimeQuantity from './TimeQuantity';
|
|
14
|
+
import TimeSpan from './TimeSpan';
|
|
15
|
+
import TimeStamp from './TimeStamp';
|
|
16
|
+
import type TimeStampValue from './TimeStampValue';
|
|
17
|
+
import TimeUnit from './TimeUnit';
|
|
18
|
+
import TimeUnitValue from './TimeUnitValue';
|
|
19
|
+
import type JsDateConvertible from './JsDateConvertible';
|
|
20
|
+
export { Gregorian, ClockTime, DateTime, DateTimeKind, howMany, TimeQuantity, TimeSpan, TimeStamp, TimeUnit, TimeUnitValue };
|
|
21
|
+
export type { CalendarDate, ClockTimeValue, TimeMeasurement, TimeStampValue, JsDateConvertible };
|
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* @author electricessence / https://github.com/electricessence/
|
|
3
|
-
* @license MIT
|
|
4
|
-
*/
|
|
5
|
-
export declare namespace hours {
|
|
6
|
-
const enum per {
|
|
7
|
-
day = 24
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
export declare namespace minutes {
|
|
11
|
-
const enum per {
|
|
12
|
-
hour = 60,
|
|
13
|
-
day = 1440
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
export declare namespace seconds {
|
|
17
|
-
const enum per {
|
|
18
|
-
minute = 60,
|
|
19
|
-
hour = 3600,
|
|
20
|
-
day = 86400
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
export declare namespace milliseconds {
|
|
24
|
-
const enum per {
|
|
25
|
-
second = 1000,
|
|
26
|
-
minute = 60000,
|
|
27
|
-
hour = 3600000,
|
|
28
|
-
day = 86400000
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
export declare namespace ticks {
|
|
32
|
-
const enum per {
|
|
33
|
-
millisecond = 10000,
|
|
34
|
-
second = 10000000,
|
|
35
|
-
minute = 600000000,
|
|
36
|
-
hour = 36000000000,
|
|
37
|
-
day = 864000000000
|
|
38
|
-
}
|
|
39
|
-
}
|
|
1
|
+
/*!
|
|
2
|
+
* @author electricessence / https://github.com/electricessence/
|
|
3
|
+
* @license MIT
|
|
4
|
+
*/
|
|
5
|
+
export declare namespace hours {
|
|
6
|
+
const enum per {
|
|
7
|
+
day = 24
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
export declare namespace minutes {
|
|
11
|
+
const enum per {
|
|
12
|
+
hour = 60,
|
|
13
|
+
day = 1440
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
export declare namespace seconds {
|
|
17
|
+
const enum per {
|
|
18
|
+
minute = 60,
|
|
19
|
+
hour = 3600,
|
|
20
|
+
day = 86400
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
export declare namespace milliseconds {
|
|
24
|
+
const enum per {
|
|
25
|
+
second = 1000,
|
|
26
|
+
minute = 60000,
|
|
27
|
+
hour = 3600000,
|
|
28
|
+
day = 86400000
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
export declare namespace ticks {
|
|
32
|
+
const enum per {
|
|
33
|
+
millisecond = 10000,
|
|
34
|
+
second = 10000000,
|
|
35
|
+
minute = 600000000,
|
|
36
|
+
hour = 36000000000,
|
|
37
|
+
day = 864000000000
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import eslint from '@eslint/js';
|
|
2
|
+
import tseslint from 'typescript-eslint';
|
|
3
|
+
|
|
4
|
+
export default tseslint.config(
|
|
5
|
+
eslint.configs.recommended,
|
|
6
|
+
...tseslint.configs.recommended,
|
|
7
|
+
{
|
|
8
|
+
rules: {
|
|
9
|
+
"semi": ["warn", "always"],
|
|
10
|
+
"indent": ["warn", "tab", { "SwitchCase": 1 }],
|
|
11
|
+
"@typescript-eslint/no-explicit-any": "off",
|
|
12
|
+
"@typescript-eslint/no-namespace": "off",
|
|
13
|
+
"@typescript-eslint/no-this-alias": "off"
|
|
14
|
+
},
|
|
15
|
+
files: ['src/**/*.ts'],
|
|
16
|
+
languageOptions: {
|
|
17
|
+
ecmaVersion: 2022,
|
|
18
|
+
sourceType: 'module',
|
|
19
|
+
globals: {
|
|
20
|
+
console: 'readonly',
|
|
21
|
+
process: 'readonly'
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
);
|