Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
fix(formatters): Fixes range-selection date formatting.
Browse files Browse the repository at this point in the history
Also checks whether we are in the same month.

fixes APM-331190
  • Loading branch information
rowa-audil authored and tomheller committed Nov 2, 2021
1 parent 6833440 commit 7a8173b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 4 additions & 1 deletion libs/barista-components/formatters/src/date/date-range.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,10 @@ export function dtFormatDateRange(
dateString1 = 'y MMM d HH:mm';
}

if (date1.getDate() === date2.getDate()) {
if (
date1.getUTCMonth() === date2.getUTCMonth() &&
date1.getDate() === date2.getDate()
) {
dateString2 = 'HH:mm';
}
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

// tslint:disable no-magic-numbers
import { Component } from '@angular/core';

import { generateData } from '../chart-data-utils';

@Component({
Expand Down

0 comments on commit 7a8173b

Please sign in to comment.