From e0812fc24c383e21ef5141745e368e42b26ec517 Mon Sep 17 00:00:00 2001 From: SuriyaR Date: Thu, 8 Aug 2019 14:45:05 +0530 Subject: [PATCH] Changes --- server/controllers/BlockchainBlock.ts | 18 +++++++++++++++++- server/socket/block.ts | 19 ++++++++++++++++++- .../home/graph-list/graph-list.component.ts | 12 ++++++------ 3 files changed, 41 insertions(+), 8 deletions(-) diff --git a/server/controllers/BlockchainBlock.ts b/server/controllers/BlockchainBlock.ts index 072276c..b9cda65 100644 --- a/server/controllers/BlockchainBlock.ts +++ b/server/controllers/BlockchainBlock.ts @@ -23,7 +23,23 @@ import { import { Paginate } from '../utils'; var moment = require('moment'); - +moment.updateLocale('en', { + relativeTime: { + future: "in %s", + past: "%s ago", + s: "seconds", + m: "1 minute", + mm: "%d minutes", + h: "1 hour", + hh: "%d hours", + d: "1 day", + dd: "%d days", + M: "1 month", + MM: "%d months", + y: "1 year", + yy: "%d years" + } +}); export class BlockchainBlockController { public path = '/blockchain_block'; public router = express.Router(); diff --git a/server/socket/block.ts b/server/socket/block.ts index 332b291..a9daa75 100644 --- a/server/socket/block.ts +++ b/server/socket/block.ts @@ -1,5 +1,22 @@ import { getConnection } from "typeorm"; -const moment = require("moment"); +var moment = require("moment"); +moment.updateLocale('en', { + relativeTime: { + future: "in %s", + past: "%s ago", + s: "seconds", + m: "1 minute", + mm: "%d minutes", + h: "1 hour", + hh: "%d hours", + d: "1 day", + dd: "%d days", + M: "1 month", + MM: "%d months", + y: "1 year", + yy: "%d years" + } +}); export async function universalGetLatestBlockDetails(socket) { diff --git a/src/app/view/home/graph-list/graph-list.component.ts b/src/app/view/home/graph-list/graph-list.component.ts index 569574c..379e7ae 100644 --- a/src/app/view/home/graph-list/graph-list.component.ts +++ b/src/app/view/home/graph-list/graph-list.component.ts @@ -469,12 +469,12 @@ export class GraphListComponent implements OnInit { { x: DifficultychartDate, y: TargetDifficulty, - text: TargetDifficulty, + text: DifficultychartDate, mode: 'lines+markers', type: 'scatter', name: '', line: { color: '#ac3333' }, - hovertemplate: '%{x}
Difficulty : %{text:,}', + hovertemplate: '%{text}
Difficulty : %{y:,}', }, // { // x: DifficultychartDate, @@ -740,7 +740,6 @@ export class GraphListComponent implements OnInit { } growthFunc(gDate, gReward, gaddedreward) { - console.log('gDate gReward gaddedreward',gDate, gReward, gaddedreward) this.growthGraphData = { data: [ { @@ -776,7 +775,8 @@ export class GraphListComponent implements OnInit { rangemode: 'nonnegative', fixedrange: true, showgrid: true, - tickformat :".0f" + tickformat :".0f", + tickprefix: ' ' }, margin: { l: 50, @@ -1096,12 +1096,12 @@ export class GraphListComponent implements OnInit { { x: DifficultychartDate, y: TargetDifficulty, - text: TargetDifficulty, + text: DifficultychartDate, mode: 'lines+markers', type: 'scatter', name: '', line: { color: '#ac3333' }, - hovertemplate: '%{x}
Difficulty : %{text:,}', + hovertemplate: '%{text}
Difficulty : %{y:,}', }, ], layout: {