summaryrefslogtreecommitdiff
path: root/node_modules/luxon/src/zone.js
diff options
context:
space:
mode:
authorShipwreckt <me@shipwreckt.co.uk>2025-10-31 20:02:14 +0000
committerShipwreckt <me@shipwreckt.co.uk>2025-10-31 20:02:14 +0000
commit7a52ddeba2a68388b544f529d2d92104420f77b0 (patch)
tree15ddd47457a2cb4a96060747437d36474e4f6b4e /node_modules/luxon/src/zone.js
parent53d6ae2b5568437afa5e4995580a3fb679b7b91b (diff)
Changed from static to 11ty!
Diffstat (limited to 'node_modules/luxon/src/zone.js')
-rw-r--r--node_modules/luxon/src/zone.js97
1 files changed, 97 insertions, 0 deletions
diff --git a/node_modules/luxon/src/zone.js b/node_modules/luxon/src/zone.js
new file mode 100644
index 0000000..f91a02e
--- /dev/null
+++ b/node_modules/luxon/src/zone.js
@@ -0,0 +1,97 @@
+import { ZoneIsAbstractError } from "./errors.js";
+
+/**
+ * @interface
+ */
+export default class Zone {
+ /**
+ * The type of zone
+ * @abstract
+ * @type {string}
+ */
+ get type() {
+ throw new ZoneIsAbstractError();
+ }
+
+ /**
+ * The name of this zone.
+ * @abstract
+ * @type {string}
+ */
+ get name() {
+ throw new ZoneIsAbstractError();
+ }
+
+ /**
+ * The IANA name of this zone.
+ * Defaults to `name` if not overwritten by a subclass.
+ * @abstract
+ * @type {string}
+ */
+ get ianaName() {
+ return this.name;
+ }
+
+ /**
+ * Returns whether the offset is known to be fixed for the whole year.
+ * @abstract
+ * @type {boolean}
+ */
+ get isUniversal() {
+ throw new ZoneIsAbstractError();
+ }
+
+ /**
+ * Returns the offset's common name (such as EST) at the specified timestamp
+ * @abstract
+ * @param {number} ts - Epoch milliseconds for which to get the name
+ * @param {Object} opts - Options to affect the format
+ * @param {string} opts.format - What style of offset to return. Accepts 'long' or 'short'.
+ * @param {string} opts.locale - What locale to return the offset name in.
+ * @return {string}
+ */
+ offsetName(ts, opts) {
+ throw new ZoneIsAbstractError();
+ }
+
+ /**
+ * Returns the offset's value as a string
+ * @abstract
+ * @param {number} ts - Epoch milliseconds for which to get the offset
+ * @param {string} format - What style of offset to return.
+ * Accepts 'narrow', 'short', or 'techie'. Returning '+6', '+06:00', or '+0600' respectively
+ * @return {string}
+ */
+ formatOffset(ts, format) {
+ throw new ZoneIsAbstractError();
+ }
+
+ /**
+ * Return the offset in minutes for this zone at the specified timestamp.
+ * @abstract
+ * @param {number} ts - Epoch milliseconds for which to compute the offset
+ * @return {number}
+ */
+ offset(ts) {
+ throw new ZoneIsAbstractError();
+ }
+
+ /**
+ * Return whether this Zone is equal to another zone
+ * @abstract
+ * @param {Zone} otherZone - the zone to compare
+ * @return {boolean}
+ */
+ equals(otherZone) {
+ throw new ZoneIsAbstractError();
+ }
+
+ /**
+ * Return whether this Zone is valid.
+ * @abstract
+ * @type {boolean}
+ */
+ get isValid() {
+ throw new ZoneIsAbstractError();
+ }
+}