Skip to content

Commit 405844e

Browse files
committed
fix(scopes): Use locale for hour scope, not minute scope
Minutes will be the same for all locales. Hours can difer (AM/PM, 24h format, ...)
1 parent fb764c8 commit 405844e

File tree

3 files changed

+2
-9
lines changed

3 files changed

+2
-9
lines changed

src/scope/hour-scope.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export class HourScope extends AbstractScope {
2121
return hours;
2222
}
2323

24-
public formatDate(date: Date): string {
24+
public formatDate(date: Date, locale?: any): string {
2525
return formatDate(date, 'HH');
2626
}
2727

src/scope/minute-scope.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export class MinuteScope extends AbstractScope {
2222
return minutes;
2323
}
2424

25-
public formatDate(date: Date, locale?: any): string {
25+
public formatDate(date: Date): string {
2626
return formatDate(date, 'mm');
2727
}
2828

test/scope/minute-scope.spec.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,6 @@ describe('MinuteScope', () => {
3333
expect(result).toBe('59');
3434
});
3535

36-
it('formatDate should respect locale', () => {
37-
const locale = undefined;
38-
const result = scope.formatDate(date, locale);
39-
expect(result).toBe('59');
40-
});
41-
42-
4336
it('title should return year', () => {
4437
const result = scope.title(date);
4538
expect(result).toBe('24. 04. 2018');

0 commit comments

Comments
 (0)