Skip to content

Commit 1bb4f41

Browse files
authored
Fix Intl data splicing bug, update ΔT. (#24)
* Fix bug in splicing Intl-derived timezone transitions onto tabularly-defined data. * Update 2022 estimated ΔT.
1 parent 5475c85 commit 1bb4f41

8 files changed

Lines changed: 15 additions & 12 deletions

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@tubular/time",
3-
"version": "3.7.3",
3+
"version": "3.7.4",
44
"description": "Date/time, IANA timezones, leap seconds, TAI/UTC conversions, calendar with settable Julian/Gregorian switchover",
55
"main": "dist/cjs/index.js",
66
"module": "dist/fesm2015/index.js",

src/timezone-large-alt.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
const timezoneLargeAlt = /* trim-file-start */{ // tz database version: 2021e, years 1800-2088, rounded to nearest minute, filtered, calendar rollbacks eliminated
44
version: '2021e',
55
years: '1800-2088',
6-
deltaTs: '69.36 69.36 69.45',
6+
deltaTs: '69.36 69.36 69.28',
77
leapSeconds: '912 1096 1461 1826 2191 2557 2922 3287 3652 4199 4564 4929 5660 6574 7305 7670 8217 8582 8947 9496 10043 10592 13149 14245 15522 16617 17167',
88
'Africa/Abidjan': '-0016 +0000 0;-g/0/LMT 0/0/GMT;1;-2ldXI;;48e5;BFCIGMGNMLMRSHSLSNTG',
99
'Africa/Algiers': '+0012 +0100 0;c/0/LMT 9/0/PMT 0/0/WET 10/10/WEST 10/0/CET 20/10/CEST;1232323232323232454542423234542324;-3bQ0c MDA3 cNb9 HA0 19A0 1iM0 11c0 1oo0 Wo0 1rc0 QM0 1EM0 UM0 DA0 Imo0 rd0 De0 9Xz0 1fb0 1ap0 16K0 2yo0 mEp0 hwL0 jxA0 11A0 dDd0 17b0 11B0 1cN0 2Dy0 1cN0 1fB0 1cL0;;26e5;DZ',

src/timezone-large.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
const timezoneLarge = /* trim-file-start */{ // tz database version: 2021e, years 1800-2088
44
version: '2021e',
55
years: '1800-2088',
6-
deltaTs: '69.36 69.36 69.45',
6+
deltaTs: '69.36 69.36 69.28',
77
leapSeconds: '912 1096 1461 1826 2191 2557 2922 3287 3652 4199 4564 4929 5660 6574 7305 7670 8217 8582 8947 9496 10043 10592 13149 14245 15522 16617 17167',
88
'Africa/Abidjan': '-001608 +0000 0;-g.8/0/LMT 0/0/GMT;1;-2ldXH.Q;;48e5;BFCIGMGNMLMRSHSLSNTG',
99
'Africa/Algiers': '+001212 +0100 0;c.c/0/LMT 9.l/0/PMT 0/0/WET 10/10/WEST 10/0/CET 20/10/CEST;1232323232323232454542423234542324;-3bQ0c.c MDA2.P cNb9.l HA0 19A0 1iM0 11c0 1oo0 Wo0 1rc0 QM0 1EM0 UM0 DA0 Imo0 rd0 De0 9Xz0 1fb0 1ap0 16K0 2yo0 mEp0 hwL0 jxA0 11A0 dDd0 17b0 11B0 1cN0 2Dy0 1cN0 1fB0 1cL0;;26e5;DZ',

src/timezone-small.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
const timezoneSmall = /* trim-file-start */{ // tz database version: 2021e, years 2016-2026
44
version: '2021e',
55
years: '2016-2026',
6-
deltaTs: '69.36 69.36 69.45',
6+
deltaTs: '69.36 69.36 69.28',
77
leapSeconds: '912 1096 1461 1826 2191 2557 2922 3287 3652 4199 4564 4929 5660 6574 7305 7670 8217 8582 8947 9496 10043 10592 13149 14245 15522 16617 17167',
88
'Africa/Abidjan': '+0000 +0000 0;0/0/GMT;;;;48e5;BFCIGMGNMLMRSHSLSNTG',
99
'Africa/Algiers': '+0100 +0100 0;10/0/CET;;;;26e5;DZ',

src/timezone.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -880,10 +880,10 @@ export class Timezone {
880880
if (insertTransitions.length > 0) {
881881
// Make sure first added transition isn't to standard time.
882882
if (fromRules && insertTransitions.length > 1 && insertTransitions[0].dstOffset === 0 &&
883-
insertTransitions[0].dstOffset !== 0)
883+
insertTransitions[1].dstOffset !== 0)
884884
insertTransitions.splice(0, 1);
885885

886-
// Make sure first added transition IS to standard time, and doesn't overlap already-created transitions.
886+
// Make sure last added transition IS to standard time, and doesn't overlap already-created transitions.
887887
while (insertTransitions.length > 0 && last(insertTransitions).dstOffset !== 0 ||
888888
last(insertTransitions).transitionTime >= transitions[1].transitionTime)
889889
insertTransitions.splice(insertTransitions.length - 1, 1);

src/ut-converter.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const TEST_DTS = [
1717
58.45, 59.19, 59.92, 60.68, 61.46, 62.23, 62.90, 63.42, 63.81, 64.08,
1818
64.27, 64.41, 64.55, 64.73, 64.95, 65.20, 65.48, 65.77, 66.06, 66.33,
1919
66.61, 66.92, 67.28, 67.69, 68.11, 68.53, 68.92, 69.24, 69.36, 69.36,
20-
69.45
20+
69.28
2121
];
2222

2323
describe('UT/TDT Converter', () => {

src/ut-converter.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,12 @@ const baseHistoricDeltaT = [
7272
66.06, 66.33, 66.61, 66.92, 67.28, 67.69, 68.11, 68.53, 68.92, 69.24
7373

7474
// From 2020 onward, data from timezone files, via updateDeltaTs().
75-
// Get additional data from https://www.iers.org/IERS/EN/DataProducts/EarthOrientationData/eop.html
76-
// As ΔT = 32.184 (for TDT - TAI) + (TAI - UTC)† - (UT1-UTC)
77-
// † 37 seconds on 2021-04-27, as will likely remain for some time.
75+
// Additional data from https://datacenter.iers.org/data/latestVersion/finals.data.iau2000.txt,
76+
// as linked to from https://www.iers.org/IERS/EN/DataProducts/EarthOrientationData/eop.html.
77+
// ΔT = 32.184† + (TAI - UTC)‡ - (UT1 - UTC)§
78+
// † TT - TAI (Terrestrial Time minus International Atomic Time), a constant value.
79+
// ‡ 37 seconds as of 2021-11-21, as it will likely remain for some time.
80+
// § From finals.data, numeric value starting at 59th character column.
7881
];
7982

8083
let historicDeltaT = clone(baseHistoricDeltaT);

0 commit comments

Comments
 (0)