Skip to content

Commit

Permalink
fix(utils): set fixed locale for date in report.md
Browse files Browse the repository at this point in the history
  • Loading branch information
matejchalk committed Jan 23, 2024
1 parent ad5da47 commit 18d793b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ ESLint rule **prefer-arrow-callback**. [📖 Docs](https://eslint.org/docs/lates
## About
Report was created by [Code PushUp](https://github.com/flowup/quality-metrics-cli#readme) on Wed Sep 15 2021 00:00:00 GMT+0000 (Coordinated Universal Time).
Report was created by [Code PushUp](https://github.com/flowup/quality-metrics-cli#readme) on Sep 15, 2021, 12:00 AM.
|Commit|Version|Duration|Plugins|Categories|Audits|
|:--|:--:|:--:|:--:|:--:|:--:|
Expand Down
2 changes: 2 additions & 0 deletions packages/utils/src/lib/reports/constants.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
export const TERMINAL_WIDTH = 80;
export const NEW_LINE = '\n';

export const LOCALE = 'en-US';

/* eslint-disable no-magic-numbers */
export const SCORE_COLOR_RANGE = {
GREEN_MIN: 0.9,
Expand Down
8 changes: 6 additions & 2 deletions packages/utils/src/lib/reports/generate-md-report.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { AuditReport, CategoryConfig, Issue } from '@code-pushup/models';
import { formatDuration, slugify } from '../formatting';
import { CommitData } from '../git';
import { NEW_LINE } from './constants';
import { LOCALE, NEW_LINE } from './constants';
import {
details,
h2,
Expand Down Expand Up @@ -229,7 +229,11 @@ function reportToAboutSection(
report: ScoredReport,
commitData: CommitData | null,
): string {
const date = new Date().toString();
const date = new Date().toLocaleString(LOCALE, {
dateStyle: 'medium',
timeStyle: 'short',
});

const { duration, version, plugins, categories } = report;
const commitInfo = commitData
? `${commitData.message} (${commitData.hash.slice(0, 7)})`
Expand Down

0 comments on commit 18d793b

Please sign in to comment.