Repository: moment/luxon (js)

Issue:
fromISO does not handle timezone when parsing ISO 8601 ordinal dates format
**Describe the bug**
When parsing the ISO 8601 ordinal date format, the time zone seems to be omitted.

**Actual vs Expected behavior**
```javascript
const { DateTime } = require('luxon');

// It expected to print 8, but got 9.
console.log(DateTime.fromISO('2013-039T09:30:26.123+09:00').setZone('Etc/GMT-8').hour);

// It expected to print 9, but got 7.
console.log(DateTime.fromISO('2013-039T07:00:00.00+0600').setZone('Etc/GMT-8').hour);
```

**Desktop (please complete the following information):**
- OS: OSX 10.15.4
- luxon: 1.26.0 and 1.25.0
- node: v14.15.4
- npm: 6.14.10


Pull request:
fix ISO year-ordinal strings with offsets
Fixes #892

Patch:
diff --git a/docs/formatting.md b/docs/formatting.md
index c7320a61..f9ab1457 100644
--- a/docs/formatting.md
+++ b/docs/formatting.md
@@ -36,7 +36,7 @@ DateTime objects can also be converted to numerical [Unix timestamps](https://en
 
 ```js
 dt.toMillis(); //=> 1492702320000
-dt.toSeconds(); //=> 1492702320.000
+dt.toSeconds(); //=> 1492702320
 dt.valueOf(); //=> 1492702320000, same as .toMillis()
 ```
 
@@ -141,8 +141,6 @@ DateTime.fromISO('2014-08-06T13:07:04.054')
   .toFormat('yyyy LLL dd'); //=> '2014 août 06'
 ```
 
-Note `toFormat` defaults to `en-US`. If you need the string to be internationalized, you need to set the locale explicitly like in the example above (or more preferably, use `toLocaleString`).
-
 ### Escaping
 
 You may escape strings using single quotes:
diff --git a/docs/moment.md b/docs/moment.md
index 1078c9d5..bcee2a85 100644
--- a/docs/moment.md
+++ b/docs/moment.md
@@ -139,7 +139,7 @@ See the [formatting guide](formatting.html) for more about the string-outputting
 | full ISO 8601    | `iso()`        | `toISO()`                   |                                                                                                                                                   |
 | ISO date only    | None           | `toISODate()`               |                                                                                                                                                   |
 | ISO time only    | None           | `toISOTime()`               |                                                                                                                                                   |
-| custom format    | `format(...)`  | `toFormat(...)`             | The format tokens differ between Moment and Luxon, such that the same format string cannot be used between the two. Note `toFormat` is meant to be used for machine-readable formats. For anything human-readable, you really want to use `toLocaleString()` instead. |
+| custom format    | `format(...)`  | `toFormat(...)`             | The format tokens differ between Moment and Luxon, such that the same format string cannot be used between the two.                               |
 | RFC 2822         |                | `toRFC2822()`               |                                                                                                                                                   |
 | HTTP date string |                | `toHTTP()`                  |                                                                                                                                                   |
 | JS Date          | `toDate()`     | `toJSDate()`                |                                                                                                                                                   |
diff --git a/scripts/bootstrap.js b/scripts/bootstrap.js
index f1b4c80b..bcb64814 100644
--- a/scripts/bootstrap.js
+++ b/scripts/bootstrap.js
@@ -4,3 +4,4 @@ global.Duration = luxon.Duration;
 global.Interval = luxon.Interval;
 global.Settings = luxon.Settings;
 global.Info = luxon.Info;
+global.IANAZone = luxon.IANAZone;
diff --git a/src/impl/regexParser.js b/src/impl/regexParser.js
index 8e4308b6..0b0297b1 100644
--- a/src/impl/regexParser.js
+++ b/src/impl/regexParser.js
@@ -267,7 +267,11 @@ const extractISOWeekTimeAndOffset = combineExtractors(
   extractISOTime,
   extractISOOffset
 );
-const extractISOOrdinalDataAndTime = combineExtractors(extractISOOrdinalData, extractISOTime);
+const extractISOOrdinalDateAndTime = combineExtractors(
+  extractISOOrdinalData,
+  extractISOTime,
+  extractISOOffset
+);
 const extractISOTimeAndOffset = combineExtractors(extractISOTime, extractISOOffset);
 
 /**
@@ -279,7 +283,7 @@ export function parseISODate(s) {
     s,
     [isoYmdWithTimeExtensionRegex, extractISOYmdTimeAndOffset],
     [isoWeekWithTimeExtensionRegex, extractISOWeekTimeAndOffset],
-    [isoOrdinalWithTimeExtensionRegex, extractISOOrdinalDataAndTime],
+    [isoOrdinalWithTimeExtensionRegex, extractISOOrdinalDateAndTime],
     [isoTimeCombinedRegex, extractISOTimeAndOffset]
   );
 }


Test patch:
diff --git a/test/datetime/regexParse.test.js b/test/datetime/regexParse.test.js
index 10f8c159..5d655887 100644
--- a/test/datetime/regexParse.test.js
+++ b/test/datetime/regexParse.test.js
@@ -435,6 +435,20 @@ test("DateTime.fromISO() accepts year-ordinalTtime", () => {
   });
 });
 
+test("DateTime.fromISO() accepts year-ordinalTtime+offset", () => {
+  const dt = DateTime.fromISO("2016-200T09:24:15.123+0600", { setZone: true });
+  expect(dt.zone.name).toBe("UTC+6");
+  expect(dt.toObject()).toEqual({
+    year: 2016,
+    month: 7,
+    day: 18,
+    hour: 9,
+    minute: 24,
+    second: 15,
+    millisecond: 123
+  });
+});
+
 test("DateTime.fromISO() accepts hour:minute:second.millisecond", () => {
   const { year, month, day } = DateTime.now();
   isSame("09:24:15.123", {