[RESOLU] Info calendar.command


#1

Bonjour tout le monde,

Alors voilà, j’essaye de crée un script qui contourne l’auto wake up en utilisant l’api sncf et le module calendar. Sauf que quand je veux récupérer l’heure précise d’un rendez-vous il me met : Thu Sep 27 2018 06:10:00 GMT+0200 (CEST).

Donc j’ai un peux cherché, et j’ai finit pas trouver ça : ‘%NEXT_EVENT_START_TIME%’: start.format(‘LT’), mais je n’ai pas bien compris comment l’utiliser.
Désolé à l’avance si la solution saute au yeux mais je débute dans les scripts.

Merci à l’avance pour votre aide.


#2

Hello!

Tu peux poster exactement à quoi ressemble ton script? :slight_smile:

Il faut que tu formate ta date. L’objet Javascript date a plein de fonctions qui te permettent de sortir le jour, l’heure, etc…


#3

Hello,merci pour ta réponse .

Je crois que j’ai compris le principe avec ce que tu viens de me montrer.
Voilà mon code pour récupérer l’heure du prochain rdv (mon script api sncf est séparé pour l’instant) :

gladys.calendar.getNextEventUser({id: 1})
.then((event) => {
console.log(event.start.getHours());
});


#4

Ok!

Et du coup tout marche maintenant? Qu’est ce qui te manque maintenant? :slight_smile:


#5

Tout marche mise à part qu’il y a un décalage de 2 heures, mais je le corriges en mettant + 2.
Maintenant, j’ai un autre problème :smile:.
J’essayes de filtrer la réponse d’une requête https (json) mais je n’arrives pas a aller jusqu’au bout, exemple:

console.log(result.departures.stop_date_time);
Donc le departures marche, mais après quand je met ‘stop_date_time’ il me met undefined.

Voilà le morceau que je veux récupérer :

0|gladys | stop_date_time:
0|gladys | { links: [],
0|gladys | arrival_date_time: ‘20180930T100000’,
0|gladys | additional_informations: [],
0|gladys | departure_date_time: ‘20180930T100000’,
0|gladys | base_arrival_date_time: ‘20180930T100000’,
0|gladys | base_departure_date_time: ‘20180930T100000’,
0|gladys | data_freshness: ‘base_schedule’ } },

Il se passe la même chose si je mets ‘arrival_date_time’ à la place de ‘stop_date_time’ .


#6

Normal, si tu es en France tu es en GMT+2 en été, et GMT+1 en hiver.

Il faut que tu change l’heure de ton Raspberry Pi je crois en mettant en fuseau horaire la France!

Tu as loggué result ? Tu peux copier ce que contient result ici ?


#7

Quand j’exécutes console.log(result.departures.stop_date_time); j’obtiens :
0|gladys | undefined


#8

ça je me doute :stuck_out_tongue:

et quand tu exécute :

console.log(result);

L’objectif c’est de savoir ce que contient cet objet!


#9

Beaucoup de chose mais je pense qu’il y une limite car il y a pas tout :

Résumé

0|gladys | { pagination:
0|gladys | { start_page: 0,
0|gladys | items_on_page: 10,
0|gladys | items_per_page: 10,
0|gladys | total_result: 10 },
0|gladys | links:
0|gladys | [ { href: ‘https://api.sncf.com/v1/coverage/sncf/stop_points/{stop_point.id}’,
0|gladys | type: ‘stop_point’,
0|gladys | rel: ‘stop_points’,
0|gladys | templated: true },
0|gladys | { href: ‘https://api.sncf.com/v1/coverage/sncf/commercial_modes/{commercial_modes.id}’,
0|gladys | type: ‘commercial_modes’,
0|gladys | rel: ‘commercial_modes’,
0|gladys | templated: true },
0|gladys | { href: ‘https://api.sncf.com/v1/coverage/sncf/stop_areas/{stop_area.id}’,
0|gladys | type: ‘stop_area’,
0|gladys | rel: ‘stop_areas’,
0|gladys | templated: true },
0|gladys | { href: ‘https://api.sncf.com/v1/coverage/sncf/physical_modes/{physical_modes.id}’,
0|gladys | type: ‘physical_modes’,
0|gladys | rel: ‘physical_modes’,
0|gladys | templated: true },
0|gladys | { href: ‘https://api.sncf.com/v1/coverage/sncf/routes/{route.id}’,
0|gladys | type: ‘route’,
0|gladys | rel: ‘routes’,
0|gladys | templated: true },
0|gladys | { href: ‘https://api.sncf.com/v1/coverage/sncf/commercial_modes/{commercial_mode.id}’,
0|gladys | type: ‘commercial_mode’,
0|gladys | rel: ‘commercial_modes’,
0|gladys | templated: true },
0|gladys | { href: ‘https://api.sncf.com/v1/coverage/sncf/vehicle_journeys/{vehicle_journey.id}’,
0|gladys | type: ‘vehicle_journey’,
0|gladys | rel: ‘vehicle_journeys’,
0|gladys | templated: true },
0|gladys | { href: ‘https://api.sncf.com/v1/coverage/sncf/lines/{line.id}’,
0|gladys | type: ‘line’,
0|gladys | rel: ‘lines’,
0|gladys | templated: true },
0|gladys | { href: ‘https://api.sncf.com/v1/coverage/sncf/physical_modes/{physical_mode.id}’,
0|gladys | type: ‘physical_mode’,
0|gladys | rel: ‘physical_modes’,
0|gladys | templated: true },
0|gladys | { href: ‘https://api.sncf.com/v1/coverage/sncf/networks/{network.id}’,
0|gladys | type: ‘network’,
0|gladys | rel: ‘networks’,
0|gladys | templated: true },
0|gladys | { href: ‘https://api.sncf.com/v1/coverage/sncf/stop_areas/stop_area:OCE:SA:87214148/departures’,
0|gladys | type: ‘first’,
0|gladys | templated: false } ],
0|gladys | disruptions: [],
0|gladys | notes: [],
0|gladys | feed_publishers: [],
0|gladys | departures:
0|gladys | [ { display_informations: [Object],
0|gladys | stop_point: [Object],
0|gladys | route: [Object],
0|gladys | links: [Array],
0|gladys | stop_date_time: [Object] },
0|gladys | { display_informations: [Object],
0|gladys | stop_point: [Object],
0|gladys | route: [Object],
0|gladys | links: [Array],
0|gladys | stop_date_time: [Object] },
0|gladys | { display_informations: [Object],
0|gladys | stop_point: [Object],
0|gladys | route: [Object],
0|gladys | links: [Array],
0|gladys | stop_date_time: [Object] },
0|gladys | { display_informations: [Object],
0|gladys | stop_point: [Object],
0|gladys | route: [Object],
0|gladys | links: [Array],
0|gladys | stop_date_time: [Object] },
0|gladys | { display_informations: [Object],
0|gladys | stop_point: [Object],
0|gladys | route: [Object],
0|gladys | links: [Array],
0|gladys | stop_date_time: [Object] },
0|gladys | { display_informations: [Object],
0|gladys | stop_point: [Object],
0|gladys | route: [Object],
0|gladys | links: [Array],
0|gladys | stop_date_time: [Object] },
0|gladys | { display_informations: [Object],
0|gladys | stop_point: [Object],
0|gladys | route: [Object],
0|gladys | links: [Array],
0|gladys | stop_date_time: [Object] },
0|gladys | { display_informations: [Object],
0|gladys | stop_point: [Object],
0|gladys | route: [Object],
0|gladys | links: [Array],
0|gladys | stop_date_time: [Object] },
0|gladys | { display_informations: [Object],
0|gladys | stop_point: [Object],
0|gladys | route: [Object],
0|gladys | links: [Array],
0|gladys | stop_date_time: [Object] },
0|gladys | { display_informations: [Object],
0|gladys | stop_point: [Object],
0|gladys | route: [Object],
0|gladys | links: [Array],
0|gladys | stop_date_time: [Object] } ],
0|gladys | context:
0|gladys | { timezone: ‘Europe/Paris’,
0|gladys | current_datetime: ‘20180930T112137’ },
0|gladys | exceptions: [] }


#10

Est quand je fais console.log(result.departures); j’ai :

Résumé

0|gladys | [ { display_informations:
0|gladys | { direction: ‘Mulhouse (Mulhouse)’,
0|gladys | code: ‘’,
0|gladys | network: ‘SNCF’,
0|gladys | links: [],
0|gladys | color: ‘000000’,
0|gladys | name: ‘Strasbourg - Mulhouse - Bâle’,
0|gladys | physical_mode: ‘Train régional / TER’,
0|gladys | headsign: ‘832307’,
0|gladys | label: ‘Strasbourg - Mulhouse - Bâle’,
0|gladys | equipments: [],
0|gladys | text_color: ‘’,
0|gladys | commercial_mode: ‘TER’,
0|gladys | description: ‘’ },
0|gladys | stop_point:
0|gladys | { commercial_modes: [Array],
0|gladys | name: ‘Erstein’,
0|gladys | links: [],
0|gladys | physical_modes: [Array],
0|gladys | coord: [Object],
0|gladys | label: ‘Erstein (Erstein)’,
0|gladys | equipments: [],
0|gladys | administrative_regions: [Array],
0|gladys | fare_zone: [Object],
0|gladys | id: ‘stop_point:OCE:SP:TrainTER-87214148’,
0|gladys | stop_area: [Object] },
0|gladys | route:
0|gladys | { direction: [Object],
0|gladys | name: ‘Strasbourg vers Mulhouse (Train TER)’,
0|gladys | links: [],
0|gladys | physical_modes: [Array],
0|gladys | is_frequence: ‘False’,
0|gladys | geojson: [Object],
0|gladys | direction_type: ‘forward’,
0|gladys | line: [Object],
0|gladys | id: ‘route:OCE:200734-TrainTER-87212027-87182063’ },
0|gladys | links: [ [Object], [Object], [Object], [Object], [Object], [Object] ],
0|gladys | stop_date_time:
0|gladys | { links: [],
0|gladys | arrival_date_time: ‘20180930T120100’,
0|gladys | additional_informations: [],
0|gladys | departure_date_time: ‘20180930T120200’,
0|gladys | base_arrival_date_time: ‘20180930T120100’,
0|gladys | base_departure_date_time: ‘20180930T120200’,
0|gladys | data_freshness: ‘base_schedule’ } },
0|gladys | { display_informations:
0|gladys | { direction: ‘Strasbourg (Strasbourg)’,
0|gladys | code: ‘’,
0|gladys | network: ‘SNCF’,
0|gladys | links: [],
0|gladys | color: ‘000000’,
0|gladys | name: ‘Strasbourg - Mulhouse - Bâle’,
0|gladys | physical_mode: ‘Train régional / TER’,
0|gladys | headsign: ‘832316’,
0|gladys | label: ‘Strasbourg - Mulhouse - Bâle’,
0|gladys | equipments: [],
0|gladys | text_color: ‘’,
0|gladys | commercial_mode: ‘TER’,
0|gladys | description: ‘’ },
0|gladys | stop_point:
0|gladys | { commercial_modes: [Array],
0|gladys | name: ‘Erstein’,
0|gladys | links: [],
0|gladys | physical_modes: [Array],
0|gladys | coord: [Object],
0|gladys | label: ‘Erstein (Erstein)’,
0|gladys | equipments: [],
0|gladys | administrative_regions: [Array],
0|gladys | fare_zone: [Object],
0|gladys | id: ‘stop_point:OCE:SP:TrainTER-87214148’,
0|gladys | stop_area: [Object] },
0|gladys | route:
0|gladys | { direction: [Object],
0|gladys | name: ‘Mulhouse vers Strasbourg (Train TER)’,
0|gladys | links: [],
0|gladys | physical_modes: [Array],
0|gladys | is_frequence: ‘False’,
0|gladys | geojson: [Object],
0|gladys | direction_type: ‘backward’,
0|gladys | line: [Object],
0|gladys | id: ‘route:OCE:200734-TrainTER-87182063-87212027’ },
0|gladys | links: [ [Object], [Object], [Object], [Object], [Object], [Object] ],
0|gladys | stop_date_time:
0|gladys | { links: [],
0|gladys | arrival_date_time: ‘20180930T122800’,
0|gladys | additional_informations: [],
0|gladys | departure_date_time: ‘20180930T122900’,
0|gladys | base_arrival_date_time: ‘20180930T122800’,
0|gladys | base_departure_date_time: ‘20180930T122900’,
0|gladys | data_freshness: ‘base_schedule’ } },
0|gladys | { display_informations:
0|gladys | { direction: ‘Sélestat (Sélestat)’,
0|gladys | code: ‘’,
0|gladys | network: ‘SNCF’,
0|gladys | links: [],
0|gladys | color: ‘000000’,
0|gladys | name: ‘Strasbourg - Sélestat Omnibus’,
0|gladys | physical_mode: ‘Train régional / TER’,
0|gladys | headsign: ‘831413’,
0|gladys | label: ‘Strasbourg - Sélestat Omnibus’,
0|gladys | equipments: [],
0|gladys | text_color: ‘’,
0|gladys | commercial_mode: ‘TER’,
0|gladys | description: ‘’ },
0|gladys | stop_point:
0|gladys | { commercial_modes: [Array],
0|gladys | name: ‘Erstein’,
0|gladys | links: [],
0|gladys | physical_modes: [Array],
0|gladys | coord: [Object],
0|gladys | label: ‘Erstein (Erstein)’,
0|gladys | equipments: [],
0|gladys | administrative_regions: [Array],
0|gladys | fare_zone: [Object],
0|gladys | id: ‘stop_point:OCE:SP:TrainTER-87214148’,
0|gladys | stop_area: [Object] },
0|gladys | route:
0|gladys | { direction: [Object],
0|gladys | name: ‘Strasbourg vers Sélestat (Train TER)’,
0|gladys | links: [],
0|gladys | physical_modes: [Array],
0|gladys | is_frequence: ‘False’,
0|gladys | geojson: [Object],
0|gladys | direction_type: ‘forward’,
0|gladys | line: [Object],
0|gladys | id: ‘route:OCE:200731-TrainTER-87212027-87214056’ },
0|gladys | links: [ [Object], [Object], [Object], [Object], [Object], [Object] ],
0|gladys | stop_date_time:
0|gladys | { links: [],
0|gladys | arrival_date_time: ‘20180930T124500’,
0|gladys | additional_informations: [],
0|gladys | departure_date_time: ‘20180930T124600’,
0|gladys | base_arrival_date_time: ‘20180930T124500’,
0|gladys | base_departure_date_time: ‘20180930T124600’,
0|gladys | data_freshness: ‘base_schedule’ } },
0|gladys | { display_informations:
0|gladys | { direction: ‘Strasbourg (Strasbourg)’,
0|gladys | code: ‘’,
0|gladys | network: ‘SNCF’,
0|gladys | links: [],
0|gladys | color: ‘000000’,
0|gladys | name: ‘Strasbourg - Sélestat Omnibus’,
0|gladys | physical_mode: ‘Train régional / TER’,
0|gladys | headsign: ‘831402’,
0|gladys | label: ‘Strasbourg - Sélestat Omnibus’,
0|gladys | equipments: [],
0|gladys | text_color: ‘’,
0|gladys | commercial_mode: ‘TER’,
0|gladys | description: ‘’ },
0|gladys | stop_point:
0|gladys | { commercial_modes: [Array],
0|gladys | name: ‘Erstein’,
0|gladys | links: [],
0|gladys | physical_modes: [Array],
0|gladys | coord: [Object],
0|gladys | label: ‘Erstein (Erstein)’,
0|gladys | equipments: [],
0|gladys | administrative_regions: [Array],
0|gladys | fare_zone: [Object],
0|gladys | id: ‘stop_point:OCE:SP:TrainTER-87214148’,
0|gladys | stop_area: [Object] },
0|gladys | route:
0|gladys | { direction: [Object],
0|gladys | name: ‘Sélestat vers Strasbourg (Train TER)’,
0|gladys | links: [],
0|gladys | physical_modes: [Array],
0|gladys | is_frequence: ‘False’,
0|gladys | geojson: [Object],
0|gladys | direction_type: ‘backward’,
0|gladys | line: [Object],
0|gladys | id: ‘route:OCE:200731-TrainTER-87214056-87212027’ },
0|gladys | links: [ [Object], [Object], [Object], [Object], [Object], [Object] ],
0|gladys | stop_date_time:
0|gladys | { links: [],
0|gladys | arrival_date_time: ‘20180930T135500’,
0|gladys | additional_informations: [],
0|gladys | departure_date_time: ‘20180930T135600’,
0|gladys | base_arrival_date_time: ‘20180930T135500’,
0|gladys | base_departure_date_time: ‘20180930T135600’,
0|gladys | data_freshness: ‘base_schedule’ } },
0|gladys | { display_informations:
0|gladys | { direction: ‘Mulhouse (Mulhouse)’,
0|gladys | code: ‘’,
0|gladys | network: ‘SNCF’,
0|gladys | links: [],
0|gladys | color: ‘000000’,
0|gladys | name: ‘Strasbourg - Mulhouse - Bâle’,
0|gladys | physical_mode: ‘Train régional / TER’,
0|gladys | headsign: ‘832309’,
0|gladys | label: ‘Strasbourg - Mulhouse - Bâle’,
0|gladys | equipments: [],
0|gladys | text_color: ‘’,
0|gladys | commercial_mode: ‘TER’,
0|gladys | description: ‘’ },
0|gladys | stop_point:
0|gladys | { commercial_modes: [Array],
0|gladys | name: ‘Erstein’,
0|gladys | links: [],
0|gladys | physical_modes: [Array],
0|gladys | coord: [Object],
0|gladys | label: ‘Erstein (Erstein)’,
0|gladys | equipments: [],
0|gladys | administrative_regions: [Array],
0|gladys | fare_zone: [Object],
0|gladys | id: ‘stop_point:OCE:SP:TrainTER-87214148’,
0|gladys | stop_area: [Object] },
0|gladys | route:
0|gladys | { direction: [Object],
0|gladys | name: ‘Strasbourg vers Mulhouse (Train TER)’,
0|gladys | links: [],
0|gladys | physical_modes: [Array],
0|gladys | is_frequence: ‘False’,
0|gladys | geojson: [Object],
0|gladys | direction_type: ‘forward’,
0|gladys | line: [Object],
0|gladys | id: ‘route:OCE:200734-TrainTER-87212027-87182063’ },
0|gladys | links: [ [Object], [Object], [Object], [Object], [Object], [Object] ],
0|gladys | stop_date_time:
0|gladys | { links: [],
0|gladys | arrival_date_time: ‘20180930T140100’,
0|gladys | additional_informations: [],
0|gladys | departure_date_time: ‘20180930T140200’,
0|gladys | base_arrival_date_time: ‘20180930T140100’,
0|gladys | base_departure_date_time: ‘20180930T140200’,
0|gladys | data_freshness: ‘base_schedule’ } },
0|gladys | { display_informations:
0|gladys | { direction: ‘Strasbourg (Strasbourg)’,
0|gladys | code: ‘’,
0|gladys | network: ‘SNCF’,
0|gladys | links: [],
0|gladys | color: ‘000000’,
0|gladys | name: ‘Strasbourg - Mulhouse - Bâle’,
0|gladys | physical_mode: ‘Train régional / TER’,
0|gladys | headsign: ‘832326’,
0|gladys | label: ‘Strasbourg - Mulhouse - Bâle’,
0|gladys | equipments: [],
0|gladys | text_color: ‘’,
0|gladys | commercial_mode: ‘TER’,
0|gladys | description: ‘’ },
0|gladys | stop_point:
0|gladys | { commercial_modes: [Array],
0|gladys | name: ‘Erstein’,
0|gladys | links: [],
0|gladys | physical_modes: [Array],
0|gladys | coord: [Object],
0|gladys | label: ‘Erstein (Erstein)’,
0|gladys | equipments: [],
0|gladys | administrative_regions: [Array],
0|gladys | fare_zone: [Object],
0|gladys | id: ‘stop_point:OCE:SP:TrainTER-87214148’,
0|gladys | stop_area: [Object] },
0|gladys | route:
0|gladys | { direction: [Object],
0|gladys | name: ‘Mulhouse vers Strasbourg (Train TER)’,
0|gladys | links: [],
0|gladys | physical_modes: [Array],
0|gladys | is_frequence: ‘False’,
0|gladys | geojson: [Object],
0|gladys | direction_type: ‘backward’,
0|gladys | line: [Object],
0|gladys | id: ‘route:OCE:200734-TrainTER-87182063-87212027’ },
0|gladys | links: [ [Object], [Object], [Object], [Object], [Object], [Object] ],
0|gladys | stop_date_time:
0|gladys | { links: [],
0|gladys | arrival_date_time: ‘20180930T152700’,
0|gladys | additional_informations: [],
0|gladys | departure_date_time: ‘20180930T152800’,
0|gladys | base_arrival_date_time: ‘20180930T152700’,
0|gladys | base_departure_date_time: ‘20180930T152800’,
0|gladys | data_freshness: ‘base_schedule’ } },
0|gladys | { display_informations:
0|gladys | { direction: ‘Sélestat (Sélestat)’,
0|gladys | code: ‘’,
0|gladys | network: ‘SNCF’,
0|gladys | links: [],
0|gladys | color: ‘000000’,
0|gladys | name: ‘Strasbourg - Sélestat Omnibus’,
0|gladys | physical_mode: ‘Train régional / TER’,
0|gladys | headsign: ‘831415’,
0|gladys | label: ‘Strasbourg - Sélestat Omnibus’,
0|gladys | equipments: [],
0|gladys | text_color: ‘’,
0|gladys | commercial_mode: ‘TER’,
0|gladys | description: ‘’ },
0|gladys | stop_point:
0|gladys | { commercial_modes: [Array],
0|gladys | name: ‘Erstein’,
0|gladys | links: [],
0|gladys | physical_modes: [Array],
0|gladys | coord: [Object],
0|gladys | label: ‘Erstein (Erstein)’,
0|gladys | equipments: [],
0|gladys | administrative_regions: [Array],
0|gladys | fare_zone: [Object],
0|gladys | id: ‘stop_point:OCE:SP:TrainTER-87214148’,
0|gladys | stop_area: [Object] },
0|gladys | route:
0|gladys | { direction: [Object],
0|gladys | name: ‘Strasbourg vers Sélestat (Train TER)’,
0|gladys | links: [],
0|gladys | physical_modes: [Array],
0|gladys | is_frequence: ‘False’,
0|gladys | geojson: [Object],
0|gladys | direction_type: ‘forward’,
0|gladys | line: [Object],
0|gladys | id: ‘route:OCE:200731-TrainTER-87212027-87214056’ },
0|gladys | links: [ [Object], [Object], [Object], [Object], [Object], [Object] ],
0|gladys | stop_date_time:
0|gladys | { links: [],
0|gladys | arrival_date_time: ‘20180930T161600’,
0|gladys | additional_informations: [],
0|gladys | departure_date_time: ‘20180930T161600’,
0|gladys | base_arrival_date_time: ‘20180930T161600’,
0|gladys | base_departure_date_time: ‘20180930T161600’,
0|gladys | data_freshness: ‘base_schedule’ } },
0|gladys | { display_informations:
0|gladys | { direction: ‘Strasbourg (Strasbourg)’,
0|gladys | code: ‘’,
0|gladys | network: ‘SNCF’,
0|gladys | links: [],
0|gladys | color: ‘000000’,
0|gladys | name: ‘Strasbourg - Mulhouse - Bâle’,
0|gladys | physical_mode: ‘Train régional / TER’,
0|gladys | headsign: ‘832320’,
0|gladys | label: ‘Strasbourg - Mulhouse - Bâle’,
0|gladys | equipments: [],
0|gladys | text_color: ‘’,
0|gladys | commercial_mode: ‘TER’,
0|gladys | description: ‘’ },
0|gladys | stop_point:
0|gladys | { commercial_modes: [Array],
0|gladys | name: ‘Erstein’,
0|gladys | links: [],
0|gladys | physical_modes: [Array],
0|gladys | coord: [Object],
0|gladys | label: ‘Erstein (Erstein)’,
0|gladys | equipments: [],
0|gladys | administrative_regions: [Array],
0|gladys | fare_zone: [Object],
0|gladys | id: ‘stop_point:OCE:SP:TrainTER-87214148’,
0|gladys | stop_area: [Object] },
0|gladys | route:
0|gladys | { direction: [Object],
0|gladys | name: ‘Mulhouse vers Strasbourg (Train TER)’,
0|gladys | links: [],
0|gladys | physical_modes: [Array],
0|gladys | is_frequence: ‘False’,
0|gladys | geojson: [Object],
0|gladys | direction_type: ‘backward’,
0|gladys | line: [Object],
0|gladys | id: ‘route:OCE:200734-TrainTER-87182063-87212027’ },
0|gladys | links: [ [Object], [Object], [Object], [Object], [Object], [Object] ],
0|gladys | stop_date_time:
0|gladys | { links: [],
0|gladys | arrival_date_time: ‘20180930T162400’,
0|gladys | additional_informations: [],
0|gladys | departure_date_time: ‘20180930T162400’,
0|gladys | base_arrival_date_time: ‘20180930T162400’,
0|gladys | base_departure_date_time: ‘20180930T162400’,
0|gladys | data_freshness: ‘base_schedule’ } },
0|gladys | { display_informations:
0|gladys | { direction: ‘Strasbourg (Strasbourg)’,
0|gladys | code: ‘’,
0|gladys | network: ‘SNCF’,
0|gladys | links: [],
0|gladys | color: ‘000000’,
0|gladys | name: ‘Strasbourg - Sélestat Omnibus’,
0|gladys | physical_mode: ‘Train régional / TER’,
0|gladys | headsign: ‘831404’,
0|gladys | label: ‘Strasbourg - Sélestat Omnibus’,
0|gladys | equipments: [],
0|gladys | text_color: ‘’,
0|gladys | commercial_mode: ‘TER’,
0|gladys | description: ‘’ },
0|gladys | stop_point:
0|gladys | { commercial_modes: [Array],
0|gladys | name: ‘Erstein’,
0|gladys | links: [],
0|gladys | physical_modes: [Array],
0|gladys | coord: [Object],
0|gladys | label: ‘Erstein (Erstein)’,
0|gladys | equipments: [],
0|gladys | administrative_regions: [Array],
0|gladys | fare_zone: [Object],
0|gladys | id: ‘stop_point:OCE:SP:TrainTER-87214148’,
0|gladys | stop_area: [Object] },
0|gladys | route:
0|gladys | { direction: [Object],
0|gladys | name: ‘Sélestat vers Strasbourg (Train TER)’,
0|gladys | links: [],
0|gladys | physical_modes: [Array],
0|gladys | is_frequence: ‘False’,
0|gladys | geojson: [Object],
0|gladys | direction_type: ‘backward’,
0|gladys | line: [Object],
0|gladys | id: ‘route:OCE:200731-TrainTER-87214056-87212027’ },
0|gladys | links: [ [Object], [Object], [Object], [Object], [Object], [Object] ],
0|gladys | stop_date_time:
0|gladys | { links: [],
0|gladys | arrival_date_time: ‘20180930T172600’,
0|gladys | additional_informations: [],
0|gladys | departure_date_time: ‘20180930T172700’,
0|gladys | base_arrival_date_time: ‘20180930T172600’,
0|gladys | base_departure_date_time: ‘20180930T172700’,
0|gladys | data_freshness: ‘base_schedule’ } },
0|gladys | { display_informations:
0|gladys | { direction: ‘Strasbourg (Strasbourg)’,
0|gladys | code: ‘’,
0|gladys | network: ‘SNCF’,
0|gladys | links: [],
0|gladys | color: ‘000000’,
0|gladys | name: ‘Strasbourg - Mulhouse - Bâle’,
0|gladys | physical_mode: ‘Train régional / TER’,
0|gladys | headsign: ‘96292’,
0|gladys | label: ‘Strasbourg - Mulhouse - Bâle’,
0|gladys | equipments: [],
0|gladys | text_color: ‘’,
0|gladys | commercial_mode: ‘TER’,
0|gladys | description: ‘’ },
0|gladys | stop_point:
0|gladys | { commercial_modes: [Array],
0|gladys | name: ‘Erstein’,
0|gladys | links: [],
0|gladys | physical_modes: [Array],
0|gladys | coord: [Object],
0|gladys | label: ‘Erstein (Erstein)’,
0|gladys | equipments: [],
0|gladys | administrative_regions: [Array],
0|gladys | fare_zone: [Object],
0|gladys | id: ‘stop_point:OCE:SP:TrainTER-87214148’,
0|gladys | stop_area: [Object] },
0|gladys | route:
0|gladys | { direction: [Object],
0|gladys | name: ‘Basel-SBB vers Strasbourg (Train TER)’,
0|gladys | links: [],
0|gladys | physical_modes: [Array],
0|gladys | is_frequence: ‘False’,
0|gladys | geojson: [Object],
0|gladys | direction_type: ‘backward’,
0|gladys | line: [Object],
0|gladys | id: ‘route:OCE:200734-TrainTER-85000109-87212027’ },
0|gladys | links: [ [Object], [Object], [Object], [Object], [Object], [Object] ],
0|gladys | stop_date_time:
0|gladys | { links: [],
0|gladys | arrival_date_time: ‘20180930T175600’,
0|gladys | additional_informations: [],
0|gladys | departure_date_time: ‘20180930T175700’,
0|gladys | base_arrival_date_time: ‘20180930T175600’,
0|gladys | base_departure_date_time: ‘20180930T175700’,
0|gladys | data_freshness: ‘base_schedule’ } } ]


#11

Pour ça, j’ai finalement remis à zéro mon installation (suite à un bug z-wave), et du coup l’heure du prochain rdv est exact :+1:


#12

C’est bon j’ai enfin compris le problème .

Il fallait écrire le [0] après le departures pour sélectionner la bonne “catégorie” !
Donc au final ça donne ceci :
console.log(result.departures[0].stop_date_time.departure_date_time);

J’avais déjà essayé le [0],mais j’avais du oublier un autre caractère :wink:


#13

Aaah top! Tu peux mettre le topic en résolu du coup?