Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed date format for csv downloaded files #1303

Merged
merged 2 commits into from
Oct 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion frontend/167.08268ac8336448ff.js

This file was deleted.

1 change: 1 addition & 0 deletions frontend/167.83f541f914b65b1a.js

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion frontend/267.3050ada6a6d9afd8.js

This file was deleted.

1 change: 1 addition & 0 deletions frontend/295.4d3b2ed9defe4e6b.js

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion frontend/315.25112d0bface4bf2.js

This file was deleted.

1 change: 1 addition & 0 deletions frontend/315.e5ad4f1953d0dadc.js

Large diffs are not rendered by default.

26 changes: 26 additions & 0 deletions frontend/3rdpartylicenses.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,32 @@ MIT
@angular/router
MIT

@babel/runtime
MIT
MIT License

Copyright (c) 2014-present Sebastian McKenzie and other contributors

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


@fortawesome/angular-fontawesome
MIT
MIT License
Expand Down
1 change: 1 addition & 0 deletions frontend/636.5775343c930ed8f6.js

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion frontend/636.b883c00cebb300aa.js

This file was deleted.

2 changes: 1 addition & 1 deletion frontend/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@
<style>html{width:100%;height:99%;line-height:1.5;overflow-x:hidden;font-family:Roboto,sans-serif!important;font-size:95%}@media only screen and (max-width: 56.25em){html{font-size:90%}}@media only screen and (max-width: 37.5em){html{font-size:80%}}body{box-sizing:border-box;height:100%;margin:0;overflow:hidden}*{margin:0;padding:0}@font-face{font-family:Roboto;src:url(Roboto-Thin.f7a95c9c5999532c.woff2) format("woff2"),url(Roboto-Thin.c13c157cb81e8ebb.woff) format("woff");font-weight:100;font-style:normal}@font-face{font-family:Roboto;src:url(Roboto-ThinItalic.b0e084abf689f393.woff2) format("woff2"),url(Roboto-ThinItalic.1111028df6cea564.woff) format("woff");font-weight:100;font-style:italic}@font-face{font-family:Roboto;src:url(Roboto-Light.0e01b6cd13b3857f.woff2) format("woff2"),url(Roboto-Light.603ca9a537b88428.woff) format("woff");font-weight:300;font-style:normal}@font-face{font-family:Roboto;src:url(Roboto-LightItalic.232ef4b20215f720.woff2) format("woff2"),url(Roboto-LightItalic.1b5e142f787151c8.woff) format("woff");font-weight:300;font-style:italic}@font-face{font-family:Roboto;src:url(Roboto-Regular.475ba9e4e2d63456.woff2) format("woff2"),url(Roboto-Regular.bcefbfee882bc1cb.woff) format("woff");font-weight:400;font-style:normal}@font-face{font-family:Roboto;src:url(Roboto-RegularItalic.e3a9ebdaac06bbc4.woff2) format("woff2"),url(Roboto-RegularItalic.0668fae6af0cf8c2.woff) format("woff");font-weight:400;font-style:italic}@font-face{font-family:Roboto;src:url(Roboto-Medium.457532032ceb0168.woff2) format("woff2"),url(Roboto-Medium.6e1ae5f0b324a0aa.woff) format("woff");font-weight:500;font-style:normal}@font-face{font-family:Roboto;src:url(Roboto-MediumItalic.872f7060602d55d2.woff2) format("woff2"),url(Roboto-MediumItalic.e06fb533801cbb08.woff) format("woff");font-weight:500;font-style:italic}@font-face{font-family:Roboto;src:url(Roboto-Bold.447291a88c067396.woff2) format("woff2"),url(Roboto-Bold.fc482e6133cf5e26.woff) format("woff");font-weight:700;font-style:normal}@font-face{font-family:Roboto;src:url(Roboto-BoldItalic.1b15168ef6fa4e16.woff2) format("woff2"),url(Roboto-BoldItalic.e26ba339b06f09f7.woff) format("woff");font-weight:700;font-style:italic}@font-face{font-family:Roboto;src:url(Roboto-Black.2eaa390d458c877d.woff2) format("woff2"),url(Roboto-Black.b25f67ad8583da68.woff) format("woff");font-weight:900;font-style:normal}@font-face{font-family:Roboto;src:url(Roboto-BlackItalic.7dc03ee444552bc5.woff2) format("woff2"),url(Roboto-BlackItalic.c8dc642467cb3099.woff) format("woff");font-weight:900;font-style:italic}</style><link rel="stylesheet" href="styles.a04c018645a5044a.css" media="print" onload="this.media='all'"><noscript><link rel="stylesheet" href="styles.a04c018645a5044a.css"></noscript></head>
<body>
<rtl-app></rtl-app>
<script src="runtime.2e7609321c648793.js" type="module"></script><script src="polyfills.aa01d8f6b94657cb.js" type="module"></script><script src="main.1a49c9ef2ba55bf2.js" type="module"></script>
<script src="runtime.2052255b31fb7bf1.js" type="module"></script><script src="polyfills.b59f900d177e9760.js" type="module"></script><script src="main.a0be7063e8c24e04.js" type="module"></script>

</body></html>
1 change: 0 additions & 1 deletion frontend/main.1a49c9ef2ba55bf2.js

This file was deleted.

1 change: 1 addition & 0 deletions frontend/main.a0be7063e8c24e04.js

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion frontend/polyfills.aa01d8f6b94657cb.js

This file was deleted.

1 change: 1 addition & 0 deletions frontend/polyfills.b59f900d177e9760.js

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions src/app/eclair/home/node-info/node-info.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing';
import { DatePipe } from '@angular/common';

import { CommonService } from '../../../shared/services/common.service';
import { DataService } from '../../../shared/services/data.service';
Expand All @@ -14,6 +15,7 @@ describe('ECLNodeInfoComponent', () => {
TestBed.configureTestingModule({
declarations: [ECLNodeInfoComponent],
providers: [
DatePipe,
CommonService,
{ provide: LoggerService, useClass: mockLoggerService },
{ provide: DataService, useClass: mockDataService }
Expand Down
2 changes: 2 additions & 0 deletions src/app/lnd/home/node-info/node-info.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing';
import { DatePipe } from '@angular/common';

import { CommonService } from '../../../shared/services/common.service';
import { DataService } from '../../../shared/services/data.service';
Expand All @@ -15,6 +16,7 @@ describe('NodeInfoComponent', () => {
TestBed.configureTestingModule({
declarations: [NodeInfoComponent],
providers: [
DatePipe,
CommonService,
{ provide: LoggerService, useClass: mockLoggerService },
{ provide: DataService, useClass: mockDataService }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,9 @@ export class ForwardingHistoryComponent implements OnInit, AfterViewInit, OnChan
this.errorMessage = !this.apiCallStatus.message ? '' : (typeof (this.apiCallStatus.message) === 'object') ? JSON.stringify(this.apiCallStatus.message) : this.apiCallStatus.message;
}
this.forwardingHistoryData = fhSelector.forwardingHistory.forwarding_events || [];
this.loadForwardingEventsTable(this.forwardingHistoryData);
if (this.forwardingHistoryData.length > 0 && this.sort && this.paginator) {
this.loadForwardingEventsTable(this.forwardingHistoryData);
}
this.logger.info(fhSelector.apiCallStatus);
this.logger.info(fhSelector.forwardingHistory);
}
Expand Down
25 changes: 23 additions & 2 deletions src/app/shared/services/common.service.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Injectable, OnDestroy } from '@angular/core';
import { DatePipe } from '@angular/common';
import { of, Observable, throwError, BehaviorSubject } from 'rxjs';
import { take, map, catchError } from 'rxjs/operators';

Expand All @@ -17,7 +18,7 @@ export class CommonService implements OnDestroy {
private containerSize = { width: 0, height: 0 };
public containerSizeUpdated: BehaviorSubject<any> = new BehaviorSubject(this.containerSize);

constructor(public dataService: DataService, private logger: LoggerService) { }
constructor(public dataService: DataService, private logger: LoggerService, private datePipe: DatePipe) { }

getScreenSize() {
return this.screenSize;
Expand Down Expand Up @@ -283,7 +284,27 @@ export class CommonService implements OnDestroy {
if (typeof obj[key] === 'object') {
dataRow += JSON.stringify(obj[key])?.replace(/\,/g, ';') + ',';
} else {
dataRow += obj[key] + ',';
if ((key.includes('timestamp') || key.includes('date'))) {
try {
switch (obj[key].toString().length) {
case 10:
dataRow += this.datePipe.transform(new Date(obj[key] * 1000), 'dd/MMM/y HH:mm') + ',';
break;

case 13:
dataRow += this.datePipe.transform(new Date(obj[key]), 'dd/MMM/y HH:mm') + ',';
break;

default:
dataRow += obj[key] + ',';
break;
}
} catch (error) {
dataRow += obj[key] + ',';
}
} else {
dataRow += obj[key] + ',';
}
}
}
} else {
Expand Down
Loading