Passed
Pull Request — master (#421)
by
unknown
02:36
created

urls.ts ➔ makeMonthUrl   A

Complexity

Conditions 1

Size

Total Lines 10
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 9
dl 0
loc 10
rs 9.95
c 0
b 0
f 0
cc 1
1
import { RouteNameResolver } from "src/Infrastructure/Common/ExtendedRouting/RouteNameResolver";
2
3
export function makeMonthUrl(resolver: RouteNameResolver, date: Date): string {
4
  const url = resolver.resolve('faircalendar_index');
5
6
  const params = new URLSearchParams({
7
    month: (date.getMonth() + 1).toString(),
8
    year: (date.getFullYear()).toString(),
9
  });
10
11
  return url + '?' + params.toString();
12
}
13