GregorianDate.js 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /**
  2. * Represents a Gregorian date in a more precise format than the JavaScript Date object.
  3. * In addition to submillisecond precision, this object can also represent leap seconds.
  4. * @alias GregorianDate
  5. * @constructor
  6. *
  7. * @see JulianDate#toGregorianDate
  8. */
  9. function GregorianDate(year, month, day, hour, minute, second, millisecond, isLeapSecond) {
  10. /**
  11. * Gets or sets the year as a whole number.
  12. * @type {Number}
  13. */
  14. this.year = year;
  15. /**
  16. * Gets or sets the month as a whole number with range [1, 12].
  17. * @type {Number}
  18. */
  19. this.month = month;
  20. /**
  21. * Gets or sets the day of the month as a whole number starting at 1.
  22. * @type {Number}
  23. */
  24. this.day = day;
  25. /**
  26. * Gets or sets the hour as a whole number with range [0, 23].
  27. * @type {Number}
  28. */
  29. this.hour = hour;
  30. /**
  31. * Gets or sets the minute of the hour as a whole number with range [0, 59].
  32. * @type {Number}
  33. */
  34. this.minute = minute;
  35. /**
  36. * Gets or sets the second of the minute as a whole number with range [0, 60], with 60 representing a leap second.
  37. * @type {Number}
  38. */
  39. this.second = second;
  40. /**
  41. * Gets or sets the millisecond of the second as a floating point number with range [0.0, 1000.0).
  42. * @type {Number}
  43. */
  44. this.millisecond = millisecond;
  45. /**
  46. * Gets or sets whether this time is during a leap second.
  47. * @type {Boolean}
  48. */
  49. this.isLeapSecond = isLeapSecond;
  50. }
  51. export default GregorianDate;