From 26069806e07724cb96173da7583569cd7a7680d1 Mon Sep 17 00:00:00 2001 From: Jannis R Date: Tue, 23 Apr 2019 17:55:46 +0200 Subject: [PATCH] remove 0 milliseconds from docs & tests --- docs/departures.md | 4 ++-- docs/journeys.md | 20 ++++++++++---------- docs/radar.md | 8 ++++---- docs/trip.md | 4 ++-- readme.md | 16 ++++++++-------- test/common.js | 18 +++++++++--------- 6 files changed, 35 insertions(+), 35 deletions(-) diff --git a/docs/departures.md b/docs/departures.md index bbd8b931..d13d8364 100644 --- a/docs/departures.md +++ b/docs/departures.md @@ -81,7 +81,7 @@ The response may look like this: regional: true } }, - when: '2017-12-17T19:32:00.000+01:00', + when: '2017-12-17T19:32:00+01:00', delay: null, platform: '2', line: { @@ -132,7 +132,7 @@ The response may look like this: tripId: '1|28671|4|86|17122017', trip: 28671, stop: { /* … */ }, - when: '2017-12-17T19:35:00.000+01:00', + when: '2017-12-17T19:35:00+01:00', delay: 0, platform: null, line: { diff --git a/docs/journeys.md b/docs/journeys.md index 12b4436c..845c922d 100644 --- a/docs/journeys.md +++ b/docs/journeys.md @@ -133,10 +133,10 @@ The `Promise` returned by `journeys()` will resolve with an object with the `jou }, products: { /* … */ } }, - departure: '2018-07-10T23:54:00.000+02:00', + departure: '2018-07-10T23:54:00+02:00', departureDelay: 60, departurePlatform: '15', - arrival: '2018-07-11T00:02:00.000+02:00', + arrival: '2018-07-11T00:02:00+02:00', arrivalDelay: 60, arrivalPlatform: '3', line: { @@ -182,10 +182,10 @@ The `Promise` returned by `journeys()` will resolve with an object with the `jou location: { /* … */ }, products: { /* … */ } }, - arrival: '2018-07-10T23:56:00.000+02:00', + arrival: '2018-07-10T23:56:00+02:00', arrivalDelay: 60, arrivalPlatform: null, - departure: '2018-07-10T23:57:00.000+02:00', + departure: '2018-07-10T23:57:00+02:00', departureDelay: 60, departurePlatform: null, remarks: [ /* … */ ] @@ -198,10 +198,10 @@ The `Promise` returned by `journeys()` will resolve with an object with the `jou location: { /* … */ }, products: { /* … */ } }, - arrival: '2018-07-11T00:02:00.000+02:00', + arrival: '2018-07-11T00:02:00+02:00', arrivalDelay: 60, arrivalPlatform: null, - departure: '2018-07-11T00:02:00.000+02:00', + departure: '2018-07-11T00:02:00+02:00', departureDelay: null, departurePlatform: null, remarks: [ /* … */ ] @@ -221,8 +221,8 @@ The `Promise` returned by `journeys()` will resolve with an object with the `jou location: { /* … */ }, products: { /* … */ } }, - departure: '2018-07-11T00:01:00.000+02:00', - arrival: '2018-07-11T00:10:00.000+02:00', + departure: '2018-07-11T00:01:00+02:00', + arrival: '2018-07-11T00:10:00+02:00', public: true, walking: true, distance: 558 @@ -296,8 +296,8 @@ client.journeys(hbf, heinrichHeineStr) ``` ``` -departure of last journey 2017-12-17T19:07:00.000+01:00 -departure of first (later) journey 2017-12-17T19:19:00.000+01:00 +departure of last journey 2017-12-17T19:07:00+01:00 +departure of first (later) journey 2017-12-17T19:19:00+01:00 ``` If you pass `polylines: true`, each journey leg will have a `polyline` field. Refer to [the section in the `trip()` docs](trip.md#polyline-option) for details. diff --git a/docs/radar.md b/docs/radar.md index d19624f2..cf25e5f4 100644 --- a/docs/radar.md +++ b/docs/radar.md @@ -90,7 +90,7 @@ The response may look like this: }, arrival: null, arrivalDelay: null, - departure: '2017-12-17T19:16:00.000+01:00', + departure: '2017-12-17T19:16:00+01:00', departureDelay: null } /* … */ ], frames: [ { @@ -145,13 +145,13 @@ The response may look like this: stop: { /* S+U Alexanderplatz/Dircksenstr. */ }, arrival: null, arrivalDelay: null, - departure: '2017-12-17T19:52:00.000+01:00', + departure: '2017-12-17T19:52:00+01:00', departureDelay: null }, { stop: { /* Memhardstr. */ }, - arrival: '2017-12-17T19:54:00.000+01:00', + arrival: '2017-12-17T19:54:00+01:00', arrivalDelay: null, - departure: '2017-12-17T19:54:00.000+01:00', + departure: '2017-12-17T19:54:00+01:00', departureDelay: null }, /* … */ ], frames: [ { diff --git a/docs/trip.md b/docs/trip.md index 6b64792a..1f19aa44 100644 --- a/docs/trip.md +++ b/docs/trip.md @@ -74,7 +74,7 @@ The response looked like this: regional: true } }, - departure: '2017-12-17T18:37:00.000+01:00', + departure: '2017-12-17T18:37:00+01:00', departurePlatform: '13', destination: { type: 'station', @@ -95,7 +95,7 @@ The response looked like this: regional: true } }, - arrival: '2017-12-17T19:49:00.000+01:00', + arrival: '2017-12-17T19:49:00+01:00', arrivalPlatform: '2', line: { type: 'line', diff --git a/readme.md b/readme.md index 3c5fb693..013fc75a 100644 --- a/readme.md +++ b/readme.md @@ -84,7 +84,7 @@ The returned [`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript }, products: { /* … */ } }, - departure: '2017-12-17T17:05:00.000+01:00', + departure: '2017-12-17T17:05:00+01:00', departurePlatform: '5', destination: { type: 'station', @@ -93,7 +93,7 @@ The returned [`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript location: { /* … */ }, products: { /* … */ } }, - arrival: '2017-12-17T17:08:00.000+01:00', + arrival: '2017-12-17T17:08:00+01:00', arrivalPlatform: '1', line: { type: 'line', @@ -121,7 +121,7 @@ The returned [`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript }, products: { /* … */ } }, - departure: '2017-12-17T17:25:00.000+01:00', + departure: '2017-12-17T17:25:00+01:00', destination: { type: 'station', id: '8098160', @@ -129,7 +129,7 @@ The returned [`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript location: { /* … */ }, products: { /* … */ } }, - arrival: '2017-12-17T17:33:00.000+01:00', + arrival: '2017-12-17T17:33:00+01:00', public: true, walking: true }, { @@ -141,7 +141,7 @@ The returned [`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript location: { /* … */ }, products: { /* … */ } }, - departure: '2017-12-17T17:37:00.000+01:00', + departure: '2017-12-17T17:37:00+01:00', departurePlatform: '1', destination: { type: 'station', @@ -150,7 +150,7 @@ The returned [`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript location: { /* … */ }, products: { /* … */ } }, - arrival: '2017-12-17T22:45:00.000+01:00', + arrival: '2017-12-17T22:45:00+01:00', arrivalPlatform: '13', line: { /* … */ }, direction: 'München Hbf' @@ -162,7 +162,7 @@ The returned [`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript location: { /* … */ }, products: { /* … */ } }, - departure: '2017-12-17T17:05:00.000+01:00', + departure: '2017-12-17T17:05:00+01:00', destination: { type: 'station', id: '8000261', @@ -170,7 +170,7 @@ The returned [`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript location: { /* … */ }, products: { /* … */ } }, - arrival: '2017-12-17T22:45:00.000+01:00', + arrival: '2017-12-17T22:45:00+01:00', price: { amount: null, hint: 'No pricing information available.' diff --git a/test/common.js b/test/common.js index d8839f20..0d726f13 100644 --- a/test/common.js +++ b/test/common.js @@ -17,7 +17,7 @@ test('exposes the profile', (t) => { test('parseDateTime: works', (t) => { const profile = {timezone: 'Europe/Berlin', locale: 'de-DE'} - const whenStr = '2019-03-18T13:19:10.000+01:00' + const whenStr = '2019-03-18T13:19:10+01:00' const when = +new Date(whenStr) const assert = (args, expected) => { @@ -33,18 +33,18 @@ test('parseDateTime: works', (t) => { // manual timezone offset assert(['20190318', '131910', 60, false], whenStr) assert(['20190318', '131910', 60, true], when) - assert(['20190318', '131910', 120, false], '2019-03-18T13:19:10.000+02:00') - assert(['20190318', '131910', 120, true], +new Date('2019-03-18T13:19:10.000+02:00')) + assert(['20190318', '131910', 120, false], '2019-03-18T13:19:10+02:00') + assert(['20190318', '131910', 120, true], +new Date('2019-03-18T13:19:10+02:00')) // day offset - assert(['20190318', '2131910', null, false], '2019-03-20T13:19:10.000+01:00') - assert(['20190318', '2131910', null, true], +new Date('2019-03-20T13:19:10.000+01:00')) - assert(['20190318', '02131910', null, false], '2019-03-20T13:19:10.000+01:00') - assert(['20190318', '02131910', null, true], +new Date('2019-03-20T13:19:10.000+01:00')) + assert(['20190318', '2131910', null, false], '2019-03-20T13:19:10+01:00') + assert(['20190318', '2131910', null, true], +new Date('2019-03-20T13:19:10+01:00')) + assert(['20190318', '02131910', null, false], '2019-03-20T13:19:10+01:00') + assert(['20190318', '02131910', null, true], +new Date('2019-03-20T13:19:10+01:00')) // manual timezone offset day offset - assert(['20190318', '02131910', 150, false], '2019-03-20T13:19:10.000+02:30') - assert(['20190318', '02131910', 150, true], +new Date('2019-03-20T13:19:10.000+02:30')) + assert(['20190318', '02131910', 150, false], '2019-03-20T13:19:10+02:30') + assert(['20190318', '02131910', 150, true], +new Date('2019-03-20T13:19:10+02:30')) t.end() })