Software zum Installieren eines Smart-Mirror Frameworks , zum Nutzen von hochschulrelevanten Informationen, auf einem Raspberry-Pi.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

zone.js 2.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. /* eslint no-unused-vars: "off" */
  2. import { ZoneIsAbstractError } from "./errors.js";
  3. /**
  4. * @interface
  5. */
  6. export default class Zone {
  7. /**
  8. * The type of zone
  9. * @abstract
  10. * @type {string}
  11. */
  12. get type() {
  13. throw new ZoneIsAbstractError();
  14. }
  15. /**
  16. * The name of this zone.
  17. * @abstract
  18. * @type {string}
  19. */
  20. get name() {
  21. throw new ZoneIsAbstractError();
  22. }
  23. /**
  24. * Returns whether the offset is known to be fixed for the whole year.
  25. * @abstract
  26. * @type {boolean}
  27. */
  28. get universal() {
  29. throw new ZoneIsAbstractError();
  30. }
  31. /**
  32. * Returns the offset's common name (such as EST) at the specified timestamp
  33. * @abstract
  34. * @param {number} ts - Epoch milliseconds for which to get the name
  35. * @param {Object} opts - Options to affect the format
  36. * @param {string} opts.format - What style of offset to return. Accepts 'long' or 'short'.
  37. * @param {string} opts.locale - What locale to return the offset name in.
  38. * @return {string}
  39. */
  40. offsetName(ts, opts) {
  41. throw new ZoneIsAbstractError();
  42. }
  43. /**
  44. * Returns the offset's value as a string
  45. * @abstract
  46. * @param {number} ts - Epoch milliseconds for which to get the offset
  47. * @param {string} format - What style of offset to return.
  48. * Accepts 'narrow', 'short', or 'techie'. Returning '+6', '+06:00', or '+0600' respectively
  49. * @return {string}
  50. */
  51. formatOffset(ts, format) {
  52. throw new ZoneIsAbstractError();
  53. }
  54. /**
  55. * Return the offset in minutes for this zone at the specified timestamp.
  56. * @abstract
  57. * @param {number} ts - Epoch milliseconds for which to compute the offset
  58. * @return {number}
  59. */
  60. offset(ts) {
  61. throw new ZoneIsAbstractError();
  62. }
  63. /**
  64. * Return whether this Zone is equal to another zone
  65. * @abstract
  66. * @param {Zone} otherZone - the zone to compare
  67. * @return {boolean}
  68. */
  69. equals(otherZone) {
  70. throw new ZoneIsAbstractError();
  71. }
  72. /**
  73. * Return whether this Zone is valid.
  74. * @abstract
  75. * @type {boolean}
  76. */
  77. get isValid() {
  78. throw new ZoneIsAbstractError();
  79. }
  80. }