Skip to content

Commit d632eca

Browse files
committed
Fixed year to millisecond conversion
1 parent 7621f0b commit d632eca

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

__tests__/yearConverter.test.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,8 @@ test('Correctly converts 3 years to 36 months', () => {
66

77
test('Correctly converts 2 years to 730 days', () => {
88
expect(T(2).years.in.days).toEqual(730);
9-
});
9+
});
10+
11+
test('Correctly converts 10 yeras to milliseconds', () => {
12+
expect(T(10).years.in.milliseconds).toEqual(3.154e+11);
13+
})

index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ let yearConverter = (value) => {
6666
get seconds() {
6767
return value * YEAR_IN_MS / SECOND_IN_MS;
6868
},
69-
get hours() {
69+
get milliseconds() {
7070
return value * YEAR_IN_MS;
7171
}
7272
}

0 commit comments

Comments
 (0)