Skip to content

Commit

Permalink
refactor(devtools): remove date utility. (angular#53997)
Browse files Browse the repository at this point in the history
We can use the `toIsoString()` function instead !

PR Close angular#53997
  • Loading branch information
JeanMeche authored and pkozlowski-opensource committed Jan 23, 2024
1 parent 3e35f74 commit ff5575a
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 66 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ ng_module(
] + _STYLE_LABELS,
deps = [
"//devtools/projects/ng-devtools/src/lib/devtools-tabs/profiler/timeline",
"//devtools/projects/ng-devtools/src/lib/vendor/chromium",
"//devtools/projects/protocol",
"//packages/common",
"//packages/core",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
import {Injectable} from '@angular/core';
import {Subject} from 'rxjs';

import {toISO8601Compact} from '../../vendor/chromium/date-utilities';

@Injectable({
providedIn: 'root',
})
Expand All @@ -32,7 +30,8 @@ export class FileApiService {

saveObjectAsJSON(object: object): void {
const downloadLink = document.createElement('a');
downloadLink.download = `NgDevTools-Profile-${toISO8601Compact(new Date())}.json`;
const isoString = new Date().toISOString().slice(0, -5); // remove milliseconds
downloadLink.download = `NgDevTools-Profile-${isoString}.json`;
downloadLink.href = URL.createObjectURL(
new Blob([JSON.stringify(object)], {type: 'application/json'}),
);
Expand Down

This file was deleted.

27 changes: 0 additions & 27 deletions devtools/projects/ng-devtools/src/lib/vendor/chromium/LICENSE

This file was deleted.

This file was deleted.

0 comments on commit ff5575a

Please sign in to comment.