/
GregorianDate.js
69 lines (69 loc) · 2.11 KB
/
GregorianDate.js
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
/**
* Represents a Gregorian date in a more precise format than the JavaScript Date object.
* In addition to submillisecond precision, this object can also represent leap seconds.
* @alias GregorianDate
* @constructor
*
* @param {Number} [year] The year as a whole number.
* @param {Number} [month] The month as a whole number with range [1, 12].
* @param {Number} [day] The day of the month as a whole number starting at 1.
* @param {Number} [hour] The hour as a whole number with range [0, 23].
* @param {Number} [minute] The minute of the hour as a whole number with range [0, 59].
* @param {Number} [second] The second of the minute as a whole number with range [0, 60], with 60 representing a leap second.
* @param {Number} [millisecond] The millisecond of the second as a floating point number with range [0.0, 1000.0).
* @param {Boolean} [isLeapSecond] Whether this time is during a leap second.
*
* @see JulianDate#toGregorianDate
*/
function GregorianDate(
year,
month,
day,
hour,
minute,
second,
millisecond,
isLeapSecond
) {
/**
* Gets or sets the year as a whole number.
* @type {Number}
*/
this.year = year;
/**
* Gets or sets the month as a whole number with range [1, 12].
* @type {Number}
*/
this.month = month;
/**
* Gets or sets the day of the month as a whole number starting at 1.
* @type {Number}
*/
this.day = day;
/**
* Gets or sets the hour as a whole number with range [0, 23].
* @type {Number}
*/
this.hour = hour;
/**
* Gets or sets the minute of the hour as a whole number with range [0, 59].
* @type {Number}
*/
this.minute = minute;
/**
* Gets or sets the second of the minute as a whole number with range [0, 60], with 60 representing a leap second.
* @type {Number}
*/
this.second = second;
/**
* Gets or sets the millisecond of the second as a floating point number with range [0.0, 1000.0).
* @type {Number}
*/
this.millisecond = millisecond;
/**
* Gets or sets whether this time is during a leap second.
* @type {Boolean}
*/
this.isLeapSecond = isLeapSecond;
}
export default GregorianDate;