This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let navOld = axios.get(newNavUrl).then(function(response) { | |
| return response.data.payload.nav; | |
| }); | |
| console.log(navOld); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let Dailyrate = fetch(oldNavUrl) | |
| .then(resp => { | |
| return resp.json(); | |
| }) | |
| .then(data => { | |
| return data.payload.nav; | |
| }) | |
| .catch(); | |
| console.log(Dailyrate); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let newNavDaily = () => | |
| fetch(oldNavUrl) | |
| .then(resp => { | |
| return resp.json(); | |
| }) | |
| .then(data => { | |
| let nav = data.payload.nav; | |
| return nav; | |
| }); | |
| newNavDaily().then(console.log); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let newNavDaily = () => | |
| fetch(newNavUrl) | |
| .then(resp => { | |
| return resp.json(); | |
| }) | |
| .then(data => { | |
| let newNav = data.payload.nav; | |
| return newNav; | |
| }); | |
| let ournewNav = newNavDaily().then(res => (nav = res)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let newNavDaily = () => | |
| fetch(newNavUrl) | |
| .then(resp => { | |
| return resp.json(); | |
| }) | |
| .then(data => { | |
| let newNav = data.payload.nav; | |
| return newNav; | |
| }); | |
| newNavDaily().then(console.log); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let oldNavDaily = () => | |
| fetch(oldNavUrl) | |
| .then(resp => { | |
| return resp.json(); | |
| }) | |
| .then(data => { | |
| let oldNav = data.payload.nav; | |
| return oldNav; | |
| }); | |
| oldNavDaily().then(console.log); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let cNew = newNav => { | |
| return newNav; | |
| }; | |
| let newNavDaily = () => | |
| fetch(newNavUrl) | |
| .then(resp => { | |
| return resp.json(); | |
| }) | |
| .then(data => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React from 'react'; | |
| import Nav from './Nav'; | |
| import ProjectionsHeader from './projectionsHeader'; | |
| import Chart from './chart'; | |
| import cookie from 'react-cookies'; | |
| import axios from 'axios'; | |
| class Projections extends React.Component { | |
| constructor() { | |
| super(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React from 'react'; | |
| import Nav from './Nav'; | |
| import ProjectionsHeader from './projectionsHeader'; | |
| import Chart from './chart'; | |
| import cookie from 'react-cookies'; | |
| import axios from 'axios'; | |
| class Projections extends React.Component { | |
| constructor() { | |
| super(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //get date in the dd-mm-yyyy format to fetch data from api | |
| this.currentYear = new Date().getFullYear(); | |
| this.currentDate = new Date(); | |
| this.currentMonth = this.currentDate.getUTCMonth() + 1; | |
| this.currentDay = this.currentDate.getUTCDate(); | |
| this.oldDay = this.currentDay - 2; | |
| this.newDay = this.currentDay - 1; | |
| if (this.currentMonth < 10) { | |
| this.currentMonth = '0' + this.currentMonth; | |
| } |