-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
103 lines (72 loc) · 3.4 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
import * as dateDealer from './lib/DateDealer';
declare module 'date-dealer' {
export function getDatesArray(startDate: string | Date, numberOfDates: number, include?: boolean): string[];
export function getDatesBefore(startDate: string | Date, numberOfDates: number, include?: boolean): string[];
export function getDatesAfter(startDate: string | Date, numberOfDates: number, include?: boolean): string[];
export function getDatesBetween(start: Date | string, end: Date | string): string[];
export function addMinutes(timeString: string, minutesToAdd: number): string;
export function getDayIndex(theDate: string | Date): number;
export function timeStampOf(date: string | Date): number;
export function ISOStringOf(date: string | Date): string;
export function isWeekEnd(date: string | Date): boolean;
export function atThisMoment(format?: string): string;
export function beforeYesterday(format?: string): string;
export function yesterday(format?: string): string;
export function tomorrow(format?: string): string;
export function afterTomorrow(format?: string): string;
export function mondayThisWeek(format?: string): string;
export function tuesdayThisWeek(format?: string): string;
export function wednesdayThisWeek(format?: string): string;
export function thursdayThisWeek(format?: string): string;
export function fridayThisWeek(format?: string): string;
export function saturdayThisWeek(format?: string): string;
export function sundayThisWeek(format?: string): string;
export function doFormat(date: string | Date, format: string): string;
export function dateOf(dateStr: string): Date;
export function calculateAge(birthDate: string | Date): {
months: number;
days: number;
years: number;
};
export function timeBetween(startTime: string | Date, endTime: string | Date): {
days: number;
hours: number;
minutes: number;
seconds: number;
};
export function timeSince(refTime: string | Date): {
days: number;
hours: number;
minutes: number;
seconds: number;
};
export function timeUntil(refTime: string | Date): {
days: number;
hours: number;
minutes: number;
seconds: number;
};
export function dateObjectOf(date: string | Date): {
plusYears(x: number): typeof dateDealer.dateObjectOf,
plusMonths(x: number): typeof dateDealer.dateObjectOf,
plusDays(x: number): typeof dateDealer.dateObjectOf,
plusHours(x: number): typeof dateDealer.dateObjectOf,
plusMinutes(x: number): typeof dateDealer.dateObjectOf,
plusSeconds(x: number): typeof dateDealer.dateObjectOf,
minusYears(x: number): typeof dateDealer.dateObjectOf,
minusMonths(x: number): typeof dateDealer.dateObjectOf,
minusDays(x: number): typeof dateDealer.dateObjectOf,
minusHours(x: number): typeof dateDealer.dateObjectOf,
minusMinutes(x: number): typeof dateDealer.dateObjectOf,
minusSeconds(x: number): typeof dateDealer.dateObjectOf,
get(format?: string): string,
};
/**
*
* @param format
* @returns {*}
*/
export function get(format?: string): string;
export function parseToDate(dateString: string): Date;
export function dateFormat(date: string | Date, format: string): string;
}